Skip to content

Instantly share code, notes, and snippets.

@kamykaze
kamykaze / config.py
Last active December 30, 2015 10:29
Text Filter server for TextAid. To use it, put these files into a directory, then run python ~/some/path/to/pytextfilter/pytextfilter.py
#!/usr/bin/env python
# vim:ft=python
config = {
"server": {
# The port that the edit server listens at
"port": 8888
},
"environment": {
# An array stores the parameters that needed to launch your text editor.
@rxaviers
rxaviers / gist:7360908
Last active May 25, 2024 09:18
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@davatron5000
davatron5000 / Sublime Text Setup.md
Last active April 15, 2023 15:39
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

@apbarrero
apbarrero / process_state_codes.md
Created August 26, 2013 07:06
Meaning of process state codes (C column) on `ps` output

PROCESS STATE CODES

Here are the different values that the s, stat and state output specifiers (header "STAT" or "S") will display to describe the state of a process.

CODE Meaning
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx kernel)
@zbyte64
zbyte64 / fix_s3_crossorigin.py
Last active December 14, 2015 23:09
Fix cross origins on S3 with boto
from boto.s3.cors import CORSConfiguration
from boto.s3.connection import S3Connection
conn = S3Connection('<aws access key>', '<aws secret key>')
bucket = conn.create_bucket('mybucket')
config = CORSConfiguration()
config.add_rule(allowed_method=['GET'], allowed_origin=['*'], allowed_header=['Content-*', 'Host'], max_age_seconds=3000)
bucket.set_cors(config)
@mfields
mfields / theme-options.php
Created January 31, 2013 01:12
Sample theme options page for WordPress Themes.
<?php
/**
* _s Theme Options
*
* @package _s
* @since _s 1.0
*/
/**
* Register the form setting for our _s_options array.
@kamykaze
kamykaze / compile_email.py
Created December 7, 2012 22:32
Script for processing an html email file (converts css to inline style and updates image paths)
#!/usr/bin/env python
import sys, getopt
from premailer import Premailer
#############################
# Compiles html email for delivery
# usage:
# python compile_email.py -i template.html -o compiled.html -b http://www.mydomain.com/static/
#
@mirisuzanne
mirisuzanne / pop-stripe.md
Created July 19, 2012 05:42
Rainbow stripe mixin with SCSS + Compass

Rainbow stripe mixin with SCSS + Compass

I'm trying to make a horizontal rainbow stripe background gradient mixin, but I feel like this is way too verbose. How can it be better?

Goals:

  1. [check] Use variables for colors so they can be swapped out for different colors.
  2. [check] The widths are hard coded for 8 colors. Can it be done smarter where it adjusts to the number of colors you add? Or is that asking too much?
  3. [check] The colors are defined twice for the color starts and stops. Can this be done better?
  4. [see below] Right now I define the colors as variables at the top level, then pass them in the mixin. Should they instead be created inside the mixin and then colors are brought in as arguments? Or does that matter?
@nikolajbaer
nikolajbaer / copy_buckets.py
Last active October 21, 2015 04:45
Sync over S3 buckets
from boto.s3.connection import S3Connection as Connection
import sys,time,threading
source, destination = sys.argv[1:]
srcconnection = Connection()
dstconnection = Connection()
source = srcconnection.get_bucket(source)
destination = dstconnection.lookup(destination) or dstconnection.create_bucket(destination)