Skip to content

Instantly share code, notes, and snippets.

@kogakure
kogakure / .gitignore
Last active December 17, 2023 08:21
Git: .gitignore file for LaTeX projects
*.acn
*.acr
*.alg
*.aux
*.bak
*.bbl
*.bcf
*.blg
*.brf
*.bst
@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
@rwilcox
rwilcox / installing_python_packages_programatically.py
Created December 26, 2010 17:32
How to use PIP to install Python packages programmatically.py
#!/usr/bin/env python
"""
PIP can stand for PIP Installs packages Programmatically, too!
(and here's how)
Requires:
* Python 2.6 or higher (for print-as-a-function)
* PIP 0.8.2
"""
@zeuxisoo
zeuxisoo / TextWrangler Script AppendHeader.scpt
Created April 15, 2011 04:41
Append header on top of document
# Neo.Lo
# 2011-04-15 12:38:10 PM
tell application "TextWrangler"
set author to "Neo.Lo"
set website to "http://studio.zeuik.com/"
set wrap to 80
set out to {}
set end of out to " * Name : " & name of document 1
@demonbane
demonbane / makeapp.sh
Created July 5, 2011 20:05
Create a Fluid-style app launcher for single-window Chrome instances on OSX
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"
@dsanson
dsanson / custom.css
Created July 12, 2011 18:16
A custom.css for use with Marked.app
/*
This is my hacked up copy of Marked.app/Contents/Resources/gridless.css
Changes:
1. Smaller headings
2. ~~No scrollbars~~ (I now prefer the Lion default behavior)
3. Styling of definition lists ala LaTeX description lists.
4. Centering h1.title, h3.author, h4.date (pandoc's title/author/date block).
@thejefflarson
thejefflarson / ts-24hour.js
Created July 24, 2011 19:06
24 hour hack.
$(".TS-year_notch_year_text").each(function(){
var el = $(this);
var text = el.text();
text = text.replace(/(\d?\d:\d\d) ((a\.m\.|p\.m\.))/, function(date, time, ampm){
var hourMinute = _.map(time.split(":"), function(it){ return parseInt(it, 10); });
if(ampm === "p.m.") {
hourMinute[0] = hourMinute[0] + 12;
} else if(ampm === "a.m." && hourMinute[0] === 12) hourMinute[0] = 0;
return hourMinute.join(".");
});
@rwilcox
rwilcox / services.markdown
Created September 21, 2011 20:26
How to create a new gist from OS X Service

How to create a Public Gist Service:

Step 0: Open Automator, New Service.

Step 1: Drag out Run Shell Script action. Pass Input to STDIN

Step 2: This code:

open `gist`
@prenagha
prenagha / pdfpenocr.scpt
Created November 10, 2011 14:57
applescript folder action to have docs ocr'd by pdfpen
--
-- OCR all documents added to a folder
--
on adding folder items to this_folder after receiving added_items
try
repeat with i from 1 to number of items in added_items
set this_item to item i of added_items
set appName to my getAppName()
tell application appName
activate
require 'rubygems'
require 'matrix'
require 'lingua/stemmer'
require 'csv'
require 'erb'
require 'iconv'
require 'sanitize'
require './cleaner.rb'
STEMMER = Lingua::Stemmer.new