Skip to content

Instantly share code, notes, and snippets.

View csarven's full-sized avatar
👽
https://csarven.ca/#i

Sarven Capadisli csarven

👽
https://csarven.ca/#i
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 21, 2024 01:20
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@isaacs
isaacs / is-rwx-able.js
Created February 24, 2011 09:49
Test whether or not a file is writable/readable/executable
exports.isReadable = isReadable
exports.isReadableSync = isReadableSync
exports.isWritable = isWritable
exports.isWritableSync = isWritableSync
exports.isExecutable = isExecutable
exports.isExecutableSync = isExecutableSync
function isReadable (path, cb) {
fs.stat(path, function (er, s) {
if (er) return cb(er)
@drocamor
drocamor / Enabling gnupg-agent for SSH authentication.sh
Created March 20, 2011 22:18
Exporting the public part of your PGP authentication subkey
# I took this from here: http://www.programmierecke.net/howto/gpg-ssh.html
# Deactivate the gnome-keyring. We will be replacing it with gnupg-agent
gconftool-2 --type bool --set /apps/gnome-keyring/daemon-components/ssh false
# Configure gpg to use the agent
echo "use-agent" >> ~/.gnupg/gpg.conf
# Enable ssh-agent drop in replacement support for gpg-agent
echo "enable-ssh-support" >> ~/.gnupg/gpg-agent.conf
@presbrey
presbrey / re-self-sign.sh
Created January 21, 2012 17:18
extends the life of an expired certificate identity
#!/bin/bash
# re-self-sign id.pem|id.p12 [days]
# extends the life of an expired certificate identity
b=$(basename $1 .p12)
b=$(basename $b .pem)
days=$2
# unwrap p12 to pem
if [ -f $b.p12 ]; then
@njh
njh / _README.md
Last active October 5, 2019 12:06
Shell script to create a WebID certificate using OpenSSL
@gasman
gasman / pnginator.rb
Created April 30, 2012 18:08
pnginator: pack Javascript into a self-extracting PNG
#!/usr/bin/env ruby -w
# pnginator.rb: pack a .js file into a PNG image with an HTML payload;
# when saved with an .html extension and opened in a browser, the HTML extracts and executes
# the javascript.
# Usage: ruby pnginator.rb input.js output.png.html
# By Gasman <http://matt.west.co.tt/>
# from an original idea by Daeken: http://daeken.com/superpacking-js-demos
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@esmooov
esmooov / checkout.md
Created May 31, 2012 15:54
The Secret Passions of Git Checkout

The Secret Passions of Git Checkout


The Hand of God

Master Hand

Git checkout can do almost anything ... or, at least, many things. It can switch branches. It can mix and match branches. It can resolve merge conflicts. It can give you a scratchpad to test things. It can even be used to interactively patch files. It's so powerful because it's so abstract. But much like numinous mystics, abstraction makes it confusing.

Basically git checkout does two things:

@mbostock
mbostock / .block
Last active March 26, 2024 18:26 — forked from mbostock/.block
Curved Links
license: gpl-3.0
@stain
stain / provenance-jsonld.json
Last active April 6, 2017 22:15
Provenance in PROV-O using JSON-LD - converted to Turtle
{
"@context": {
"xsd": "http://www.w3.org/2001/XMLSchema#",
"prov": "http://www.w3.org/ns/prov#",
"foaf": "http://xmlns.com/foaf/0.1/",
"agent": { "@type": "@id", "@id": "prov:agent" },
"entity": { "@type": "@id", "@id": "prov:entity" },
"activity": { "@type": "@id", "@id": "prov:activity" },
"hadPlan": { "@type": "@id", "@id": "prov:hadPlan" },