This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- a quick LUA access script for nginx to check IP addresses against an | |
| -- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
| -- | |
| -- allows for a common blacklist to be shared between a bunch of nginx | |
| -- web servers using a remote redis instance. lookups are cached for a | |
| -- configurable period of time. | |
| -- | |
| -- block an ip: | |
| -- redis-cli SADD ip_blacklist 10.1.1.1 | |
| -- remove an ip: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Here is the curl commands I use to test - make sure you update the CAPSVARS. You can add an item ID Payload or not. | |
| //For example if your app displays items, it can navigate to a specific item. | |
| //If you want to add more state names, instead of only going to specific items: | |
| //add another payload property called 'stateName' | |
| //create a goState() function to accept a stateName as a parameter | |
| //and modify the registerPush() to find the stateName property and pass into your goState(). | |
| //Android | |
| curl -u YOURAPIKEY: -H "Content-Type: application/json" -H "X-Ionic-Application-Id: APPID" https://push.ionic.io/api/v1/push -d '{"tokens":["ANDROIDTOKEN"],"notification":{"alert":"I come from planet Ion.", "android":{"title":"This is a title2", "payload":{"sound":"notification.mp3","itemId":"7TF00hJI78Y"}}}}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .directive('backSpaceNotBackButton', [function(){ | |
| return { | |
| restrict: 'A', | |
| link: function(scope, element, attrs){ | |
| // This will stop backspace from acting like the back button | |
| $(element).keydown(function (e) { | |
| var elid = $(document.activeElement) | |
| .filter( | |
| "input:not([type], [readonly]),"+ | |
| "input[type=text]:not([readonly]), " + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class algebraLineal{ | |
| public static void main(String []args){ | |
| int m[][]; | |
| int mTraspuesta[][]; | |
| int determinante; | |
| int N=ES.leeNº("Introduzca el numero de filas o columnas de la matriz",2); | |
| m=new int[N][N]; | |
| escribirMatriz(m); | |
| //ES es una clase creada para leer de teclado | |
| int opcion=ES.leeNº("Seleccione una opción\n---------------\n\t1.- Mostrar la matriz\n\t2.- Comprobar si la matriz es simétrica\n\t3.- Mostrar la matriz traspuesta\n\t4.- Calcular el determinante\n\t0.- Salir",0,4); |