Skip to content

Instantly share code, notes, and snippets.


Carter Cole neopunisher

View GitHub Profile
IanColdwater / twittermute.txt
Last active May 20, 2022
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here:
neopunisher / inject-react.js
Last active Jan 22, 2021
Pull react into the page
View inject-react.js
var out=document.createElement("div");'testing';
console.log('loaded babel')
Babel.registerPlugin('eval_wrapper', function eval_wrapper() { return {visitor: {
FunctionDeclaration(path) {
console.log('a func')
// debugger
simonw /
Last active May 11, 2022
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using and

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
neopunisher / captureYoutubeFrame.js
Last active May 18, 2018
grabs a frame out of youtube
View captureYoutubeFrame.js
var a=z.querySelector("video"),b=z.createElement("canvas"),c=b.getContext("2d"),d=z.createElement("a");b.width=a.videoWidth;b.height=a.videoHeight;c.drawImage(a,0,0);"FileName.png";d.href=b.toDataURL();z.body.appendChild(d);;z.body.removeChild(d);
View install phantomjs 2.1.1 - ubuntu
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
nathan-osman / win32.go
Last active May 23, 2022
Simple Windows GUI application written in Go
View win32.go
package main
import (
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")

Creating a redis Module in 15 lines of code!

A quick guide to write a very very simple "ECHO" style module to redis and load it. It's not really useful of course, but the idea is to illustrate how little boilerplate it takes.

Step 1: open your favorite editor and write/paste the following code in a file called module.c

#include "redismodule.h"
/* ECHO <string> - Echo back a string sent from the client */
int EchoCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
joselitosn /
Created Mar 16, 2016
Python SMB Example
from smb.SMBConnection import SMBConnection
userID = 'user'
password = 'password'
client_machine_name = 'localpcname'
server_name = 'servername'
server_ip = ''
domain_name = 'domainname'
Avaq / combinators.js
Last active May 20, 2022
Common combinators in JavaScript
View combinators.js
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
danawoodman /
Last active May 23, 2022
React Hello World Examples

React "Hello World" Examples

Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.

They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).


You will want to create an index.html file and copy/paste the contents of 1-base.html and then create a scripts.js file and copy/paste the contents of one of the examples into it.