Skip to content

Instantly share code, notes, and snippets.

View animista01's full-sized avatar
🤓

Bryan Villafañe animista01

🤓
View GitHub Profile
Immutable state tree
Dispatch actions
Pure fuctions don't modify the attributes that the recieve and also alway return the same value for the same params
Reducer: takes the previus state, the action to be dispatch and returns the next state.
Reducers change(But don't mutate it) properties in the store
action has a type
use payload as a convention for naming actions' values
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO
@animista01
animista01 / calificacionDocenteAutoClick.js
Last active November 12, 2015 18:34
Dar click automáticamente en la calificación de docentes de la U Simon Bolivar
for(var i = 1; i <= 20; i++){
console.log($('input[name=radEva_'+i+']'));
$('input[name=radEva_'+i+']').click();
};
@animista01
animista01 / gist:c3963bb9e0cd7a03926d
Last active April 20, 2017 02:19
Show/remove markers from a Map by clicking checkboxes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Central Gmap</title>
<script src="https://code.jquery.com/jquery-1.11.2.js"></script>
<script src="https://maps.google.com/maps/api/js?sensor=true"></script>
<script src="gmaps.js"></script>
</head>
<body>
@animista01
animista01 / like.js
Last active November 8, 2017 18:26
Dar Like en Facebook a todas las publicaciones que estén en pantalla
// 1. Ir a la pagina a la que se le quiere dar 'likes' a sus publicaciones
//Con el siguiente codigo se llega al final de la pagina automaticamente. Repetir hasta que sea necesario (Recomendable que haya cargado < de 50 publicaciones)
// 2. Pegar lo siguiente hasta que consideres necesario.
window.scrollTo(0, document.body.scrollHeight);
setTimeout(function(){
window.scrollTo(0, document.body.scrollHeight);
}, 2000);
@animista01
animista01 / websql.coffee
Last active August 29, 2015 13:58
WebSQL implemented in Coffeescript
db = null
constructor: ->
# WebSQL Database
db = openDatabase('myDB', '1.0', 'this is my DB', 2 * 1024 * 1024)
db.transaction (tx) =>
tx.executeSql("CREATE TABLE IF NOT EXISTS mytable (id, name, stuff)",
[],
(tx, results) => console.log(results),
(tx, error) => console.error(error),
)
@animista01
animista01 / gist:6630934
Last active October 5, 2019 14:13
Store values from foreach loop into array
<?php
$data = array();
foreach ($tareas as $tarea) {
$data[] = $tarea;
}
var_dump($data);
?>
@animista01
animista01 / gist:5544248
Last active December 17, 2015 03:38
Acceder al option seleccionado de un select (Etiqueta HTML)
window.onload = function() {
$("select").change(function () {
var str = "";
$("select option:selected").each(function () {
str += $(this).text();
});
compr(str);
});
function compr(str){
if(str == 'Vendedor'){