Skip to content

Instantly share code, notes, and snippets.

.bashrc
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
export HISTSIZE=100000 # big big history
export HISTFILESIZE=100000 # big big history
shopt -s histappend # append to history, don't overwrite it
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
@cemk
cemk / linebreak.py
Created October 29, 2011 14:52
Creating linebreaks and paragraphs in Jinja2/Flask à la Django Style
import re
from jinja2 import evalcontextfilter, Markup, escape
@app.template_filter()
@evalcontextfilter
def linebreaks(eval_ctx, value):
"""Converts newlines into <p> and <br />s."""
value = re.sub(r'\r\n|\r|\n', '\n', value) # normalize newlines
paras = re.split('\n{2,}', value)
@jensgro
jensgro / extern-link.css
Created December 6, 2011 11:03
css attribute selectors
@tsabat
tsabat / zsh.md
Last active October 16, 2024 14:43
Getting oh-my-zsh to work in Ubuntu
@ocean90
ocean90 / gist:1549988
Created January 2, 2012 09:13
Custom border radius mixin for Compass
// Custom Border Radius
@mixin _border-radius($radius: 5px, $vertical-radius: false) {
@if $vertical-radius {
// Webkit doesn't understand the official shorthand syntax for specifying
// a vertical radius unless so in case there's several we only take the first.
@include experimental(border-radius, first-value-of($radius) first-value-of($vertical-radius),
not -moz,
-webkit,
not -o,
@alotaiba
alotaiba / google_speech2text.md
Created February 3, 2012 13:20
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@jxson
jxson / README.md
Created February 10, 2012 00:18
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@kuleszaj
kuleszaj / gist:1911050
Created February 25, 2012 21:53
Nginx with X-Forwarded-Proto set for SSL
server {
listen 1.2.3.4:443;
server_name railsapp.example.com;
ssl on;
ssl_certificate cert.pem;
ssl_certificate_key cert.key;
location / {
proxy_set_header X-Forwarded-Proto https;
# Sets the HTTP headers appropiately;
proxy_pass http://rails_application;
@davidkaneda
davidkaneda / _user-select.scss
Created March 3, 2012 21:05
User select mixin
@mixin user-select($select) {
$select: unquote($select);
@include experimental(user-select, $select,
-moz, -webkit, not -o, not -ms, -khtml, official
);
}
@stonehippo
stonehippo / adding-HA-hack-to-all-children.css
Created March 8, 2012 01:52
Adding Webkit native scrolling to an element
.scrolling-element-class * {
-webkit-transform: translate3d(0,0,0);
}