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
@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
@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" }
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) {
@0xjac
0xjac / private_fork.md
Last active April 26, 2024 14:38
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@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]
@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);
});
@RuGa
RuGa / massInsertOrUpdate.php
Last active April 12, 2024 16:54
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows
@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. ---"
@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 })
@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: