Skip to content

Instantly share code, notes, and snippets.

View notthetup's full-sized avatar
🔊

Chinmay Pendharkar notthetup

🔊
View GitHub Profile
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@remy
remy / audiosprite.js
Created December 23, 2010 13:54
An example of how an audio sprite can be used (includes fixes for iOS)
function Track(src, spriteLength, audioLead) {
var track = this,
audio = document.createElement('audio');
audio.src = src;
audio.autobuffer = true;
audio.load();
audio.muted = true; // makes no difference on iOS :(
/* This is the magic. Since we can't preload, and loading requires a user's
input. So we bind a touch event to the body, and fingers crossed, the
@aehlke
aehlke / gist:992798
Created May 26, 2011 08:53 — forked from jamesmacaulay/gist:860763
zsh hooks to growl completion of long-running commands
# long-running command growler
# hooks for zsh, built on bash version at http://hints.macworld.com/article.php?story=20071009124425468
preexec_functions+='save_preexec_time'
save_preexec_time() {
export PREEXEC_CMD="$(history $HISTCMD | sed 's/ *[0-9]* *//')"
export PREEXEC_TIME=$(date +'%s')
}
precmd_functions+='growl_about_long_running_commands'
@granoeste
granoeste / gist:1033085
Created June 18, 2011 13:15
[Android]Using the Handler and Lopper with HandlerThread
// With reference to the android.app.IntentService of the Android framework
// Member variable
private volatile Looper mServiceLooper;
private volatile ServiceHandler mServiceHandler;
// Handler Class
private final class ServiceHandler extends Handler {
public ServiceHandler(Looper looper) {
super(looper);
@javisantana
javisantana / license.txt
Last active August 30, 2023 07:07
NMEA parser in java which does not suck
this software is under the terms of MIT license: http://opensource.org/licenses/MIT
@jonathanmoore
jonathanmoore / gist:1473089
Created December 13, 2011 17:45
Tumblr <embed> striping
<!-- Embed code for Mixcloud -->
<object width="480" height="480">
<param name="movie" value="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http%3A%2F%2Fwww.mixcloud.com%2Fvlekrecords%2Fssaliva-lrzpm%2F&embed_uuid=ae879085-19b7-4e66-86b0-9e2e50835c9d&stylecolor=&embed_type=widget_standard"></param>
<param name="allowFullScreen" value="true"></param>
<param name="wmode" value="opaque"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf?feed=http%3A%2F%2Fwww.mixcloud.com%2Fvlekrecords%2Fssaliva-lrzpm%2F&embed_uuid=ae879085-19b7-4e66-86b0-9e2e50835c9d&stylecolor=&embed_type=widget_standard" type="application/x-shockwave-flash" wmode="opaque" allowscriptaccess="always" allowfullscreen="true" width="480" height="480"></embed>
</object>
<!-- Embed code after Tumblr strips the <embed> tag -->
@jboner
jboner / latency.txt
Last active May 3, 2024 15:17
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@scottburton11
scottburton11 / gist:3222152
Created August 1, 2012 00:58
Audio Compression for Voiceover

About compression

Audio compression is used to reduce the dynamic range of a recording. Dynamic range is the difference between the loudest and softest parts of an audio signal. It was originally used to guard against defects when cutting wax and vinyl phonograph records, but generally became useful as a way of increasing the loudness of an audio recording without achieving distortion.

The goal of most compression applications is to increase the amplitude of the softest parts of a recording, without increasing the amplitude of the loudest parts.

Compressor anatomy

Compressors generally all have the same conceptual parts. However, not all compressors present variable controls for all parts to the user. If you don't see all of your compressor's controls here, there's a chance it either has a fixed value (and no control), or is named something else:

@sora
sora / Makefile
Created September 16, 2012 07:15
Lattice Diamond: command-line build
BOARD_DIR=../rtl
CORES_DIR=../../../cores
BOARD_NAME="LatticeECP3"
DEVICE_NAME="LFE3-35EA"
PKG_NAME="FPBGA484"
PER_GRADE=8
SEARCH_PATH="/usr/local/diamond/2.0/ispfpga/ep5c00/data"
include common.mak
@rahulg
rahulg / _x_segfault.c
Created October 4, 2012 06:22
Free segfaults for everyone!
#define _x_segfault() \
__asm__ __volatile__ ("movq $0, %%r11\n" \
"movq (%%r11), %%r10\n" \
: \
: \
: "%r11", "%r10" \
)