Skip to content

Instantly share code, notes, and snippets.

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active August 26, 2025 19:11
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@dfm
dfm / _chi2.c
Created August 3, 2012 13:41
How to wrap C code in Python
#include <Python.h>
#include <numpy/arrayobject.h>
#include "chi2.h"
/* Docstrings */
static char module_docstring[] =
"This module provides an interface for calculating chi-squared using C.";
static char chi2_docstring[] =
"Calculate the chi-squared of some data given a model.";
@chrismeyersfsu
chrismeyersfsu / gist:3270358
Created August 6, 2012 04:22
Arduino Poor man's oscilloscope
#define ANALOG_IN 0
void setup() {
Serial.begin(9600);
//Serial.begin(115200);
}
void loop() {
int val = analogRead(ANALOG_IN);
Serial.write( 0xff );
@chrismeyersfsu
chrismeyersfsu / oscilloscope.c
Last active January 7, 2024 14:15
Arduino Poor man's oscilloscope processing code
/*
* Oscilloscope
* Gives a visual rendering of analog pin 0 in realtime.
*
* This project is part of Accrochages
* See http://accrochages.drone.ws
*
* (c) 2008 Sofian Audry ([email protected])
*
* This program is free software: you can redistribute it and/or modify
@vojtajina
vojtajina / all-templates.html
Created August 15, 2012 00:00
AngularJS: load all templates in one file
<script type="text/ng-template" id="one.html">
<div>This is first template</div>
</script>
<script type="text/ng-template" id="two.html">
<div>This is second template</div>
</script>
@dalibor
dalibor / rspec_cucumber_learning.markdown
Created August 22, 2012 07:46 — forked from nebojsaz/rspec_cucumber_learning.markdown
Rspec + Cucumber how to on Codebreaker example

Behavior Driven Development

Description of BDD

  • Domain-driven design

Principles of BDD

  • Enough is enough
@webhat
webhat / gist:3772793
Created September 23, 2012 19:44
Add File to Evernote with Tags
on run {input}
tell application "Evernote"
repeat with SelectedFile in input
try
display dialog "Tags for " & SelectedFile default answer ""
set value to text returned of result
set AppleScript's text item delimiters to ","
set the_tags to text items of value
set the_tags to the_tags & {"file", "paper", "book"}
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@unnu
unnu / paperclip_redis.rb
Created December 10, 2012 21:20
Paperclip Redis Storage
module Paperclip::Storage::Redis
def self.extended(base)
base.instance_eval do
@options[:path] = ":class/:attachment/:id_partition/:style/:filename"
@options[:url] = "/dynamic/:class/:attachment/:id_partition/:style/:filename"
@redis = Redis.new
end
end