Skip to content

Instantly share code, notes, and snippets.

View nucliweb's full-sized avatar

Joan León nucliweb

View GitHub Profile
@icodesido
icodesido / Raw vs jQuery AJAX
Created May 21, 2014 13:51
Raw vs jQuery AJAX
$.getJSON('/my/url', function(data) {
});
vs
request = new XMLHttpRequest();
request.open('GET', '/my/url', true);
request.onload = function() {
@victor-falcon
victor-falcon / gist:2021125
Created March 12, 2012 10:47
Saving Contact Form 7 data into a MailChimp List
<?php
/*
Guardando email de Contact Form 7 en MailChimp
Necesita el archivo MCAPI.class.php de la API de MailChimp
En este en concreto usamos un checbox con el nombre subscribe para comprobar si el
usuario quiere subscribirse o no. En caso afirmativo guardamos el nombre y el email
en la lista concreta de nuestro MailChimp.
@davecarter
davecarter / expandEmmet.sublime-keymap
Created November 20, 2015 07:53
Expand Emmet inside JSX
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
@carlosvillu
carlosvillu / download.js
Last active December 22, 2015 22:58
Download Wallpapers from Blizzard
const range = require('lodash.range');
const flatten = require('flatten');
const Promise = require('bluebird');
const fs = require('fs');
const RANGE = 60;
const RESOLUTIONS = ['1440x900','1600x900'];
const STATUS_OK = 200;
const ENCODING_FILE = 'binary';
@carlosvillu
carlosvillu / cookie-parser.js
Last active December 28, 2015 10:27
Utility to work with cookies
@AllThingsSmitty
AllThingsSmitty / toggle-css-script-on-off.js
Created November 15, 2015 19:39
Disable/enable a stylesheet or script
// Use the Boolean `disabled` attribute
myCSS.disabled = true;
myJS.disabled = true;
// Create a stylesheet toggle button:
var stylesheet = document.getElementById('boot'),
btn = document.querySelector('.btn');
btn.addEventListener('click', function () {
stylesheet.disabled = (stylesheet.disabled === false) ? true : false;
@nahuelsotelo
nahuelsotelo / error.js
Last active April 20, 2016 09:23
ERROR HANDLER
var beep = require('beepbeep');
var colors = require('colors');
var onError = function(err) {
beep([200, 200]);
var formatOutput = function(context) {
var msg, file, line, description;
if(context == 'gulp-babel') {
@nucliweb
nucliweb / Git.md
Last active July 29, 2016 16:31
Git Tips

Git notes

git init                          <-- Create repo

git add .                         <-- Add change to
git commit -m "Message"          <-- Commit to repo
git commit -m "Message" <files>  <-- Commit to repo
git commit -am "Message"         <-- Add files & Commit to repo
git commit -a --amend             <-- Add change to Commit, option to change de description of Commit
@carlosvillu
carlosvillu / webpack.hjs.js
Created August 4, 2016 08:49
La configuración de webpack definitiva
const webpack = require('webpack')
const getConfig = require('hjs-webpack')
const isDev = (process.env.NODE_ENV || 'development') === 'development'
const isProd = !isDev && process.env.NODE_ENV === 'production'
const PRO_PUBLIC_PATH = ''
const DEV_PUBLIC_PATH = ''
const PUBLIC_PATH = isProd ? PRO_PUBLIC_PATH : DEV_PUBLIC_PATH
const GA_ID = 'UA-XXXXX-Y'
@klamping
klamping / notes.md
Last active November 1, 2017 18:00
Visual Regression Testing Resources