Skip to content

Instantly share code, notes, and snippets.

View diniremix's full-sized avatar

Jorge Brunal diniremix

View GitHub Profile
@diniremix
diniremix / pulse.sh
Last active August 29, 2015 14:15
a simple script to generate skeletons for Web applications
#/bin/sh
PULSEPHP_URL="https://github.com/diniremix/pulsePHP/archive/master.zip"
PULSEJS_URL="https://gist.githubusercontent.com/diniremix/8df589843792342197cd/raw/deebde566b25316fc39c8da5a18a4eeb9e88efa4/pulseJS.js"
TEST_DIR="./test"
APP_DIR="./js"
function help(){
echo;
echo -e "\e[1;97mpulse\e[0m - a simple script to generate skeletons for Web applications";
@diniremix
diniremix / gist:1370410
Created November 16, 2011 15:44 — forked from persand/gist:1355589
Bash script for github.com/x URL:s -> git.io
function shit() {
if [ -n "$2" ]; then
curl -i http://git.io -F url=https://github.com/"$1" -F code="$2";
else
curl -i http://git.io -F url=https://github.com/"$1";
fi
}
@RonnyO
RonnyO / console.lol.js
Created January 16, 2013 09:17
Like console.log, just a tiny bit funnier
// console.lol by @RonnyOrbach, idea by Erez Avny
if (typeof console != 'undefined') console.lol = function(){
var args = [].slice.call(arguments, 0);
args.unshift("LOL");
args.push("LOLOLOL!")
console.log.apply(console, args);
};
@addyosmani
addyosmani / examples.md
Last active February 23, 2016 18:22
Object.observe() examples from my talk

What are we trying to observe? Raw object data.

// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
 
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
@robdodson
robdodson / underscore-mustache-jade-template.jade
Created August 6, 2012 23:19
Mustache, Underscore, Jade template
script(type="text/html", id="modal-service-selection")
.modal-service-selection.modal-centered.modal.stretch.hide.fade
.modal-header
a.button-close(data-dismiss='modal')
img(src="../img/icons/latest/icon-exit.png")
h3 You have selected
span.emphasize {{ service.name }}
p Please select the subcategory that fits your needs:
.modal-body
ul.l-horizontal.clearfix.reservation-entries
@benyanke
benyanke / fidget.sh
Last active November 5, 2017 07:13
Bash fidget spinner
# Bash Fidget Spinner
# Could also be included in a bashrc file
fidget() {
start_time="0.02";
spin_efficiency="0.99";
end_time="3";
time="$start_time";
printf "\e[92mPress any key to give another spin...\n\n";
@vuejsdevelopers
vuejsdevelopers / app.js
Created October 31, 2017 13:26
Build A Lazy-Load Router With Vue.js And The Latest Browser Features - Snippet 05
import BooksPage from './pages/BooksPage.js';
new Vue({
el: '#app',
data: {
page: BooksPage
},
methods: {
navigate(event) {
this.page = () => import(`./${event.target.pathname}`)
// Vue.js < 2.5.0
@neilsoult
neilsoult / LazyLoad.js
Created October 31, 2013 19:40
LazyLoad directive for loading external javascript for AngularJs. In this example, I use google maps' API as the external library being loaded
angular.module('testApp', []).
directive('lazyLoad', ['$window', '$q', function ($window, $q) {
function load_script() {
var s = document.createElement('script'); // use global document since Angular's $document is weak
s.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize';
document.body.appendChild(s);
}
function lazyLoadApi(key) {
var deferred = $q.defer();
$window.initialize = function () {
from itertools import islice
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db
from firebase_admin import firestore
def _split(data, size=500):
"""Splits a dictionary into a sequence of smaller dictionaries."""
@jamiekurtz
jamiekurtz / gist:d325baa979dd3f64f8d1
Created March 6, 2015 03:54
Install Kazam on Fedora
# 1. download zip from https://launchpad.net/kazam
# 2. extract into target folder
# install prerequisites (works on Fedora 21 with Python 3)
sudo yum install python3-distutils-extra python3-dbus intltool
# run the included setup from within the unzipped folder
sudo python3 setup.py install
# Done! Can start with either `kazam` command or find Kazam in the menu