Skip to content

Instantly share code, notes, and snippets.

@sebble
sebble / github.api
Created June 23, 2014 20:43
GitHub, GitLab, Prose.io API comparisons
DELETE /applications/:client_id/tokens
DELETE /applications/:client_id/tokens/:access_token
GET /applications/:client_id/tokens/:access_token
POST /applications/:client_id/tokens/:access_token
GET /authorizations
POST /authorizations
PUT /authorizations/clients/:client_id
DELETE /authorizations/:id
GET /authorizations/:id
PATCH /authorizations/:id
@jlongster
jlongster / gruntfile.js
Created December 19, 2013 20:38
gruntfile
var fs = require('fs');
var path = require('path');
var sweet = require('sweet.js');
module.exports = function(grunt) {
grunt.initConfig({
sweetjs: {
options: {
modules: ['es6-macros'],
sourceMap: true,
@domenic
domenic / es6-modules.md
Last active December 26, 2015 00:19
Authoritative ES6 Modules Resources

This is an initial attempt at gathering together up to date resources on ES6 modules.

  • The ES6 draft spec has an up-to-date grammar and list of early errors. It's not the easiest thing to read, but is the most authoritative.
  • This informal grammar summary is pretty good, and starts to explain how default exports work.
  • These two comments in sequence give examples of all the import and export forms available.
  • jorendorff/js-loaders is a polyfill for the module loader API and pipeline, and is where current work is taking place.
  • This essay is out of date in many ways, but I believe its explanation of the loader pipeline is still more or less accurate. To be sure you'd have to check it agai
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@sloria
sloria / bobp-python.md
Last active May 12, 2024 06:54
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@kzap
kzap / gist:5819745
Last active May 27, 2020 23:09
If you want to give only Travis-CI access to a private key or secret file in your repository, you will need to encrypt it, but rather than storing the entire encrypted file in an environment variable, just store the a secret password in a secure environment variable that you will use to encrypt and decrypt your private key file. The encryption o…
# generate your private key, put the public key on the server you will be connecting to
ssh-keygen -t rsa -f ./my_key
# generate the password/secret you will store encrypted in the .travis.yml and use to encrypt your private key
cat /dev/urandom | head -c 10000 | openssl sha1 > ./secret
# encrypt your private key using your secret password
openssl aes-256-cbc -pass "file:./secret" -in ./my_key -out ./my_key.enc -a
# download your Travis-CI public key via the API. eg: https://api.travis-ci.org/repos/travis-ci/travis-ci/key
@mikedeboer
mikedeboer / async_jsm.md
Last active December 16, 2015 20:49
Simplify async code-flows and unify unit tests

Simplify async code-flows and unify unit tests

The thing I always do when I encounter a large code base, is roam though it and make a mental map of the structure; the good parts and ones that would benefit from some TLC. A part I noticed did not yet receive the amount of attention it deserves are unit tests and asynchronous code handling. I'll be blunt about it, here's what I did: I ported the async NodeJS library to a Mozilla-style module and on top of that I built a unit testing library, inspired by Mocha (among others). I can imagine that the fellas I just mentioned don't make you recall anything, so here are two links:

First of all, the Github numbers will show you that they are crazy popular NodeJS libraries. And well-documented. And well-written. And awesome.

@Gozala
Gozala / examples.js
Created March 27, 2013 22:16
Caveats with sync promises
// Function returns promise for once window.document.readyState
// becomes interactivate.
function whenInteractive(window) {
let { promise, resolve } = defer()
let state = window.document.readyState;
if (state === "complete") resolve(window)
if (state === "interactive") resolve(window)
else {
window.addEventListener("DOMContentLoaded", function(event) {
// Is current window?
@nicdaCosta
nicdaCosta / Grep.js
Last active March 9, 2024 13:39
Basic function that searches / filters any object or function and returns matched properties.
/*
Grep.js
Author : Nic da Costa ( @nic_daCosta )
Created : 2012/11/14
Version : 0.2
(c) Nic da Costa
License : MIT, GPL licenses
Overview:
Basic function that searches / filters any object or function and returns matched properties.
@leofeyer
leofeyer / contao-db-update.php
Created August 9, 2012 13:04
Update path in database
<?php
// Database credentials
$strHost = 'localhost';
$strUser = '';
$strPassword = '';
$strDatabase = '';
// From and to path
$strFrom = 'tl_files/';