Skip to content

Instantly share code, notes, and snippets.

View devinivy's full-sized avatar

devin ivy devinivy

View GitHub Profile
@moshest
moshest / appspec.yml
Last active October 13, 2021 18:09
Node.js Project on AWS CodeDeploy CentOS
version: 0.0
os: linux
files:
- source: /
destination: /home/ec2-user/node
permissions:
- object: /home/ec2-user
owner: ec2-user
group: ec2-user
type:
@CMCDragonkai
CMCDragonkai / functions_and_closures.rs
Last active July 29, 2019 22:05
Rust: Higher Order Functions & Closures (Rust 1.7 Stable) - Creating the Haskell's `$` function in Rust.
fn main() {
let closure_immutable_pure = |x: i32| x + 1;
let result1 = apply_pure(& closure_immutable_pure, 1);
// let result2 = apply_mut(&mut closure_immutable_pure, 2); // not typeable
let result3 = apply_once(closure_immutable_pure, 3);
let mut closure_mutable_pure = |x: i32| x + 1;
I inlined the code from microAjax there, to keep dependencies at 0. I think the following cite satisfies the license?
https://code.google.com/archive/p/microajax/
This code was referenced extensively:
https://bitbucket.org/snippets/jdubray/9dgKp/sam-sample
@markerikson
markerikson / jdubray-gitter-logs.md
Last active January 30, 2021 04:09
jdubray statements on Redux

Jean-Jacques Dubray
@jdubray
Feb 06 23:05
@robwormald welcome! honored to speak to you. If you like Redux, well, SAM is the correct semantics that Redux should have had. It tried to speak to Dan about it, but he never replied to me. SAM's semantics are based on TLA+ so you can't find a more robust formalism.

Stardrive Engineering
@HighOnDrive

On linux, shebang accepts only one argument.
As we use nvm we can't adress node executable by path and have to resort to /usr/bin/env.
Unfortunately `#!usr/bin/env node --harmony` won't work since it needs 2 arguments ...
This [article](http://sambal.org/2014/02/passing-options-node-shebang-line/) proposes a hack.
The content of the article is copied below.
{ 2014 02 01 }
Passing options to node on the shebang (#!) line
@iammerrick
iammerrick / PinchZoomPan.js
Last active April 22, 2024 02:54
React Pinch + Zoom + Pan
import React from 'react';
const MIN_SCALE = 1;
const MAX_SCALE = 4;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active July 8, 2025 11:45
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@princejwesley
princejwesley / await-babel-repl.js
Last active January 9, 2021 09:20
REPL with standalone await + babel transform
const repl = require('repl');
const babel = require('babel-core');
function preprocess(input) {
const awaitMatcher = /^(?:\s*(?:(?:let|var|const)\s)?\s*([^=]+)=\s*|^\s*)(await\s[\s\S]*)/;
const asyncWrapper = (code, binder) => {
let assign = binder ? `global.${binder} = ` : '';
return `(function(){ async function _wrap() { return ${assign}${code} } return _wrap();})()`;
};
@jkraemer
jkraemer / cli.ini
Last active September 14, 2020 12:39
Let's Encrypt certificate renewal with HAProxy
# Use a 4096 bit RSA key instead of 2048
rsa-key-size = 4096
# update to register with the specified e-mail address
email = [email protected]
# use a text interface instead of ncurses
text = True
non-interactive = True
agree-tos = True
@caseywatts
caseywatts / quicktime-hangouts-recording.md
Last active February 14, 2024 02:18
Quicktime Hangouts Recording (using soundflower for audio)

Short link to this page: caseywatts.com/quicktime

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Quicktime + Hangouts Recording

Scenario: You want to talk with someone over google hangouts (like for a user study), and you want to record BOTH: