Skip to content

Instantly share code, notes, and snippets.

View joemccann's full-sized avatar
💭
Thinking

Joe McCann joemccann

💭
Thinking
View GitHub Profile
@Aatch
Aatch / borrow-example.rs
Last active July 5, 2023 04:22 — forked from kolmodin/rust-json.rs
An example and explanation of how to use lifetimes and borrowing to avoid copying, while maintaining safety.
extern mod extra;
use extra::json::*;
/*
* This function manages to do absolutely no copying, which is pretty cool.
*
* "What are all those `'r`s?" you ask. Well, they're liftime parameters. They
* indicate how long something lasts (before it's freed). They can't change how
* long something lives for, they only allow you to tell the compiler stuff it
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@mbostock
mbostock / .block
Last active November 22, 2022 23:32
Line Transition
license: gpl-3.0
@pec1985
pec1985 / app.js
Created December 30, 2011 17:21
LinkedIn effect - Titanium
// right navigation button
var btn = Ti.UI.createButton({
title:'button'
});
// window
var win = Ti.UI.createWindow({
rightNavButton:btn,
backgroundColor:'blue'
});
@davidwood
davidwood / FUCK-YA.md
Created December 9, 2011 19:59
List content type of files in Cloudfiles container

How to list the content type of all files in a Cloudfiles container.

  1. Install node and npm
  2. Install the awesome Cloudfiles package from Nodejitsu
  3. Create a folder and save the dw-is-my-hero.js to that folder
  4. Edit dw-is-my-hero.js and change USERNAME and API_KEY to your username and API key
  5. Run node dw-is-my-hero.js CONTAINER_NAME
  6. Smile (and tell people how rad node.js is)
@calderas
calderas / npm.js
Created October 6, 2011 18:57
npm setup
npm config set registry http://registry.npmjs.org/
npm config set proxy http://http-proxy.com:80
npm install -d
How to add cmd-left-arrow and cmd-right-arrow (without shift) key bindings to the mac os x Terminal
app if the Lion install removed this bindings from your system.
1) Open "System Preferences".
2) Go to "Keyboard".
3) Select the "Keyboard Shortcuts" tab.
4) Select "Application Shortcuts" from the list of items in the left.
5) Press "+" to add a new shurtcut.
6) As "Application" select "Terminal", as "Menu Title" use: "Select Next Tab". For the "Keyboard Shortcut" field just select the field and press cmd-right-arrow.
7) Repeat again from step 5, using "Select Previous Tab" as Menu Title and pressing cmd-left-arrow as keyboard shortcut.
@brianleroux
brianleroux / npm-picnic.md
Created September 6, 2011 19:11
nodeconf camp discussion about npm things

npm hangout

wherein we hang out and talk about npm stuff and occasionally mock ruby

using npm for building node extensions

  • npm catches missing node-waf and/or node-waf deps like python - charlie
<html>
<head>
<script src="/socket.io/socket.io.js"></script>
</head>
<body>
<div id="output"></div>
<script>
function write (msg) {
var p = document.createElement('p');
p.innerHTML = 'LOG: ' + msg;
@saikat
saikat / gist:1084146
Created July 15, 2011 05:43
Stripe sample checkout form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Sample Form</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<script type="text/javascript">