Skip to content

Instantly share code, notes, and snippets.

View cgiffard's full-sized avatar

Christopher Giffard cgiffard

  • Canberra, Australia
View GitHub Profile
out/
src/
myfiles.md
static/
img/
assets/
styles.css
tpl/
index.jade
build.js
@john2x
john2x / 00_destructuring.md
Last active May 5, 2025 14:54
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@cubiq
cubiq / select-reset.html
Created May 27, 2014 12:12
How to reset a select tag
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Styled Select</title>
</head>
<style>
* {
@wolfeidau
wolfeidau / cross-compile.sh
Created May 20, 2013 22:51
Awesome script for cross compiling nodejs and packaging it in a deb
#!/bin/bash
OLDPATH=${PATH}
UpdateBox()
{
echo "-> Installing apt-get packages"
aptitude update
aptitude -y install build-essential
aptitude -y remove libruby1.8 ruby1.8 ruby1.8-dev rubygems1.8
@jedi4ever
jedi4ever / Compiling_Nodejs_Single_File.md
Last active October 10, 2020 15:12
Notes on compiling/packaging a node.js projects as a single binary

Compiling plain javascript (no external modules)

So we got nexe to compile nodejs projects to an executable binary:

  • it downloads the nodejs source
  • it creates a single file nodejs source (using sardines )
  • it monkey patches the nodejs code to include this single file in the binary (adding it to the lib/nexe.js)

$ nexe -i myproject.js -o myproject.bin -r 0.10.3

Caveats:

  • I had an issue with unicode chars that got converted: it uses uglify.js and this needs to be configured to leave them alone
@deoxxa
deoxxa / usage
Last active January 15, 2021 19:20
lol "streaming video"
ffmpeg -i /path/to/a/video -f rawvideo -vcodec rawvideo -s 60x24 -pix_fmt rgb24 - 2>/dev/null | ./video.js 60 24
check it out: http://d.pr/i/wjEj
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@paulmillr
paulmillr / active.md
Last active May 7, 2025 14:35
Most active GitHub users (by contributions). https://paulmillr.com

Most active GitHub users (git.io/top)

The list would not be updated for now. Don't write comments.

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:

githubUsers
@gabehollombe
gabehollombe / gist:2468822
Created April 23, 2012 04:10
SSH tunnel between two NATed machines via a third SSH host
Useful for when you need to have two hosts talk to each other on a specific port but they're both NATed (behind routers).
For example, you want to be able to SSH into your friend's machine to pair program with them.
host-machine$ ssh -R 55555:localhost:22 myaccount@my_ssh_server.com
connecting-machine$ ssh -L 55555:localhost:55555 myaccount@my_ssh_server.com
connecting-machine$ ssh -p 55555 user_on_host_machine@localhost