Skip to content

Instantly share code, notes, and snippets.

@rjrodger
rjrodger / servegif.js
Created January 26, 2011 16:50
node.js: serve a 1x1 gif
var connect = require('connect')
var imgdata = [
0x47,0x49, 0x46,0x38, 0x39,0x61, 0x01,0x00, 0x01,0x00, 0x80,0x00, 0x00,0xFF, 0xFF,0xFF,
0x00,0x00, 0x00,0x21, 0xf9,0x04, 0x04,0x00, 0x00,0x00, 0x00,0x2c, 0x00,0x00, 0x00,0x00,
0x01,0x00, 0x01,0x00, 0x00,0x02, 0x02,0x44, 0x01,0x00, 0x3b
]
var imgbuf = new Buffer(imgdata)
var server = connect.createServer(
@jacqui
jacqui / gist:983051
Created May 20, 2011 14:43 — forked from pauldix/gist:981916
Redis SORT command examples
# Optimized for writes, sort on read
# LVC
redis.hset("bonds|1", "bid_price", 96.01)
redis.hset("bonds|1", "ask_price", 97.53)
redis.hset("bonds|2", "bid_price", 95.50)
redis.hset("bonds|2", "ask_price", 98.25)
redis.sadd("bond_ids", 1)
redis.sadd("bond_ids", 2)
@kvz
kvz / mac_apps_101_by_kvz.md
Created November 17, 2011 10:40
Mac Apps 101

kvz: "I'm recommending these Mac apps to a colleague who's losing his OSX virginity: https://gist.github.com/1372883. Anything you think I should add?"

Don't forget to look at the suggestions at the bottom, there's some cool stuff in there.

Essential

  • 1Password - password manager. intergrates with Dropbox & all main webbrowsers so you'll never lose a password again
  • Dropbox - a free 2GB folder in your homedir that stays in sync with all the devices you also install it on (linux/windows/mac/ipad/iphone/etc). Useful for backup, collaboration (share 1 folder with others), and keeping important documents with you.
  • Chrome - browsing
  • Colloquy - IRC
@gre
gre / easing.js
Last active June 13, 2024 12:18
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@shamil
shamil / .bashrc
Last active June 22, 2020 12:42 — forked from anonymous/.bashrc
Configure OSX shell to be like Debian/Ubuntu. Requires MacPorts.
# ~/.bashrc: executed by bash(1) for non-login shells.
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #

UPDATE

Although below are methods to extract the contents of a macOS package without actually installing it, the best way might be to create a blank disk image and install the package to this disk image in order to inspect the package contents. To do so:

  • Open the Disk Utility app.
  • Choose "File > New Image > Blank Image". Alternatively, simply press CMD-N.
  • Set the parameters and click on "Save" to create the blank disk image.
  • After creation, it should be already mounted. If not, you can mount it by navigating to the directory that it is placed at and double clicking on the disk image file.
  • Run the package installer by double clicking on the package file.
  • Select this newly created blank disk image as the destination and install it.
  • If the script is preventing you from installing by saying, for example, "macOS isn't installed", you can:
@pythoninthegrass
pythoninthegrass / autorun.sh
Created February 20, 2021 23:08
QNAP /tmp/config/autorun.sh for disabling advanced power management (APM) for noisy HDDs
#!/usr/bin/env bash
# SOURCES:
# https://www.brainbytez.nl/tutorials/qnap-nas-fix-the-seagate-chirp-sound/
# Disable advanced power management (APM) for noisy Seagate drives
# qcli_storage
hdparm -B 255 /dev/sda
hdparm -B 255 /dev/sdb
hdparm -B 255 /dev/sdc