Skip to content

Instantly share code, notes, and snippets.

View Fishrock123's full-sized avatar
💭
#freepalestine #blacklivesmatter #acab drop ICE you cowards

Jeremiah Senkpiel Fishrock123

💭
#freepalestine #blacklivesmatter #acab drop ICE you cowards
View GitHub Profile
@joyeecheung
joyeecheung / download.sh
Last active November 14, 2017 05:52
Quickly download a repo at a ref without git history, useful if you need multiple tag/commit/branch of it
REF=8680bb9
# The following work as well
# REF=master
# REF=V8.x-staging
# REF=V8.9.1
wget https://github.com/nodejs/node/archive/$REF.tar.gz
mkdir -p $REF
tar zxvf $REF.tar.gz -C $REF --strip-components=1
cd $REF
@LotteMakesStuff
LotteMakesStuff / ReadOnlyAttribute.cs
Created January 17, 2017 00:17
ReadOnly property drawer for Unity~ Add a [ReadOnly] attribute to a property to make it show up as read only in the inspector
// NOTE DONT put in an editor folder
using UnityEngine;
public class ReadOnlyAttribute : PropertyAttribute { }
@marcan
marcan / linux.sh
Last active December 1, 2023 15:18
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@Akamaozu
Akamaozu / exclusive_executor.js
Created November 17, 2016 21:57
Make sure a callback is triggered only once
function exclusive_execute( real_callback ){
var triggered_callback = false;
return function(){
if( triggered_callback ) return;
triggered_callback = true;
real_callback();
}
@joshgav
joshgav / node_env_mgr.md
Last active November 3, 2016 21:23
Justification for managing Node environment managers in the Node Foundation.

Environment managers like Python's venv/virtualenv, Ruby's rvm, and Node's nvm make it easy for users to install and configure a runtime's versions and constituent components. Each virtual environment can support a specific runtime version and configuration and an independent set of global modules. In fact, some runtimes, such as .NET Core, can bundle and refer to a specific runtime configuration for each app. To summarize, environment managers enable developers to:

  • install the runtime with a specific configuration.
  • change runtime configurations for test and other needs.
  • manage runtime and component updates.
a = [];
// issues more common
;a[0] = (function(){return this})();
;a[1] = (function(a){a='shared';return arguments;}('isolated');
;a[2] = (function () {return typeof this;}).call(1);
// issues less common
var scope = 'global';
;a[3] = (function(scope) {return eval('scope')})();
@bcomnes
bcomnes / ban-ip
Last active March 23, 2016 23:47
command to ban an IP using sshguard. requires sudo/root
#!/usr/bin/env bash
USAGE="Usage: $0 ipv4-address"
BLACKLISTDB="/var/db/sshguard/blacklist.db"
if [ "$#" == "0" ]; then
echo "$USAGE"
exit 1
fi
@trevnorris
trevnorris / main.cc
Created February 5, 2016 23:53
Run a callback when an object is GC'd
#include <v8.h>
#include <node.h>
using namespace v8;
typedef void (*FreeCallback)(Local<Object> object, Local<Function> fn);
class CallbackStuff {
public:
@benlesh
benlesh / happy-promises.js
Last active February 5, 2016 00:59
I reject your reality
/**
* Running this file in Node (>4) will demonstrate that unhandled exceptions in promises will
* cause the process to continue running in a happy way, logging all 3 numbers.
* */
setTimeout(function () {
console.log(3);
}, 100);
console.log(1);
new Promise(function () {
@ChALkeR
ChALkeR / grep.2015-09-21.object.observe.txt
Last active November 2, 2015 21:14
lzgrep -h ':.*Object\.observe' slim.code.ts.lzo slim.code.coffee.lzo slim.code.js.lzo | grep -vE '[^:]+:[0-9]+:\s*(/\*|//)'
fast-json-patch-0.5.4.tgz/src/json-patch-duplex.ts:294: if(Object.observe) {
fast-json-patch-0.5.4.tgz/src/json-patch-duplex.ts:332: if (Object.observe) {
fast-json-patch-0.5.4.tgz/src/json-patch-duplex.ts:417: if (Object.observe) {
fast-json-patch-0.5.4.tgz/src/json-patch-duplex.ts:418: Object.observe(obj, observer);
fast-json-patch-0.5.4.tgz/src/json-patch-duplex.ts:432: if (Object.observe) {
fast-json-patch-0.5.4.tgz/src/json-patch-duplex.ts:447: if (Object.observe) {
mayhem-0.3.0-alpha.31.tgz/_debug/binding/bindings/Es7Binding.ts:13: * The Es7Binding uses Object.observe to observe an object for changes.
rx-3.1.2.tgz/ts/core/linq/observable/ofobjectchanges.ts:12: * Creates an Observable sequence from changes to an object using Object.observe.
rx-3.1.2.tgz/ts/core/linq/observable/ofobjectchanges.ts:14: * @returns {Observable} An observable sequence containing changes to an object from Object.observe.
shared-0.2.0.tgz/lib/tracker.ts:14: * proposed Object.observe model but