Skip to content

Instantly share code, notes, and snippets.

View nicolas-t's full-sized avatar
🦏
opensourcing

Nicolas Turlais nicolas-t

🦏
opensourcing
View GitHub Profile
@higuma
higuma / ArrayPermutation.coffee
Last active December 18, 2015 13:02
CoffeeScript Array permutation generator
# internal: generate permutation recursively
generatePermutation = (perm, pre, post, n) ->
if n > 0
for i in [0...post.length]
rest = post.slice 0
elem = rest.splice i, 1
generatePermutation perm, pre.concat(elem), rest, n - 1
else
perm.push pre
return
@lunelson
lunelson / gulpfile.js
Created January 20, 2015 11:42
Gulp configuration for running sassc directly
var autoprefixer = require('gulp-autoprefixer');
var buffer = require('vinyl-buffer');
var gulp = require('gulp');
var gutil = require('gulp-util');
var plumber = require('gulp-plumber');
var rename = require("gulp-rename");
var run = require('gulp-run');
gulp.task('sassc', function () {
gulp.src('test/test.scss', { buffer: false })
@112KA
112KA / console_log.sublime-macro
Last active May 19, 2018 00:10
output console.log() shortcut in Sublime Text
[
{ "args": {"to": "word"}, "command": "expand_selection" },
{ "args": null, "command": "copy" },
{ "args": { "to": "eol" }, "command": "move_to" },
{ "args": { "characters": "\n" }, "command": "insert" },
{ "args": { "characters": "console.log('" }, "command": "insert" },
{ "args": null, "command": "paste" },
{ "args": { "characters": ": ', " }, "command": "insert" },
{ "args": null, "command": "paste" },
{ "args": { "characters": ");" }, "command": "insert" }
@uhtred
uhtred / lodash.toggle-array-value.js
Created September 26, 2016 20:55
Lodash: toggle array value
_.xor([1], [2]);
= [1, 2]
_.xor([1, 2], [2]);
= [1]
@cluppi
cluppi / after.sh
Created March 19, 2015 19:01
Turning SSL on for Homestead
#!/bin/sh
# Config for SSL.
echo "--- Making SSL Directory ---"
mkdir /etc/nginx/ssl
echo "--- Copying $i SSL crt and key ---"
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com"
echo "--- Turning SSL on in nginx.conf. ---"
import hoistStatics from 'hoist-non-react-statics';
import React from 'react';
/**
* Allows two animation frames to complete to allow other components to update
* and re-render before mounting and rendering an expensive `WrappedComponent`.
*/
export default function deferComponentRender(WrappedComponent) {
class DeferredRenderWrapper extends React.Component {
constructor(props, context) {
@kenprice
kenprice / guess_seeds.py
Last active June 26, 2022 15:41
cryptogreetings r/Bitcoin puzzle - BIP49 seed word guessing util
from electrum import util, keystore, bitcoin
import argparse
import sys
import threading
MAX_THREADS=25
TARGET_ADDR="3CcxyPhyvyc3S9UuPfu42GNZLvVVV11Uk8"
# How many of the address indexes to try. Default to just /0.
# i.e. last digit in derivation path: m/49'/0'/0'/0/0
MAX_ADDR_IDX=1
@n3dst4
n3dst4 / ConEmu Git Bash.md
Last active July 19, 2022 17:11
My ConEmu / Cmder git bash task config
  1. Open Conemu

  2. Open Settings -> Tasks or go to new tab button -> Setup tasks.

  3. Click + to add a new task

  4. Enter the name as Git Bash or whatever you like

  5. Task parameters:

     /icon "C:\Program Files (x86)\Git\etc\git.ico" /dir "C:\_git"
    
  6. Command:

@davej
davej / transitionToPromise.js
Last active January 31, 2023 15:49
Do a CSS transition and resolve promise when complete
const transitionToPromise = (el, property, value) =>
new Promise(resolve => {
el.style[property] = value;
const transitionEnded = e => {
if (e.propertyName !== property) return;
el.removeEventListener('transitionend', transitionEnded);
resolve();
}
el.addEventListener('transitionend', transitionEnded);
});