Skip to content

Instantly share code, notes, and snippets.

View kn9ts's full-sized avatar
🌠
I am one with the force!

Eugene Mutai kn9ts

🌠
I am one with the force!
View GitHub Profile
(function() {
var cache = {};
this.tmpl = function(str, data) {
cache[str] = cache[str] ||
new Function('data', [
'var _p="";\nwith(arguments[0]||{}){\n_p+="',
str.replace(/"/g, '\\$&')
.replace(/[\r\n]/g, '')
.replace(/<%([^\w\s\}\)]*)\s*(.*?)\s*%>/g, function(match, mark, code) {
if (mark === '=') return '"+(' + code + ')+"';
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active June 1, 2024 14:20
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@slightlyoff
slightlyoff / push_api_sketch.md
Last active June 7, 2018 07:15
Service Worker + Push API

Motivation

The current Push API Draft specifies a system that has no notion of push channel persistence. Further, it does not include push message payloads, a feature that many developers want.

This gist outlines an API which:

  • integrates with the Service Worker to enable delivery of push messages to applications which do not have visible tabs
  • enables a JSON-formatted body of content
  • guards access to registration for pushes on potential user consent
@erichiggins
erichiggins / ndb_json.py
Last active May 23, 2021 00:27
JSON serializer/deserializer adapted for use with Google App Engine's NDB Datastore API. This script can handle Model, Expando, PolyModel, Query, QueryIterator, Key, datetime, struct_time, and complex types.
#!/usr/bin/env python
"""
JSON encoder/decoder adapted for use with Google App Engine NDB.
Usage:
import ndb_json
# Serialize an ndb.Query into an array of JSON objects.
query = models.MyModel.query()
@hubgit
hubgit / request-queue.js
Created February 20, 2014 17:38
JS Request queue
var queue = [
'https://peerj.com/articles/1.json',
'https://peerj.com/articles/2.json',
'https://peerj.com/articles/3.json',
];
var run = function() {
var xhr = new XMLHttpRequest;
xhr.open('GET', queue.shift());
xhr.responseType = 'json';
@staltz
staltz / introrx.md
Last active May 30, 2024 18:43
The introduction to Reactive Programming you've been missing
@alecthegeek
alecthegeek / go-install-tools
Last active September 3, 2015 18:18
Set up a "standard" go project workspace with support for 3rdparty modules, version control repo and a template main package
# Install all the Go tools and godep tool
# Location of gobin is based on installation by OS X Homebrew
sudo -u admin GOPATH=/tmp GOBIN=/usr/local/opt/go/bin go get -u golang.org/x/tools/cmd/...
sudo -u admin GOPATH=/tmp GOBIN=/usr/local/opt/go/bin go get -u github.com/tools/godep
@sogko
sogko / app.js
Last active November 8, 2022 12:31
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@koba04
koba04 / .gitignore
Last active December 21, 2018 02:21
karma + mocha + browserify + babel + power-assert
node_modules/
@busypeoples
busypeoples / AngularJS-ES6-Test-Skeleton
Last active June 6, 2020 01:29
AngularJS - Karma, Jasmine, Browserify, Stringify - ES6 Test Setup
We couldn’t find that file to show.