Skip to content

Instantly share code, notes, and snippets.

@alexcabrera
alexcabrera / hack-ia_writer.markdown
Created June 25, 2011 19:50
Easily style HTML output from iA Writer
  1. Right-click on iA Writer.app in your Applications folder, select "Show Package Contents"
  2. Open up Resources/English.lproj/htmlTemplate.html in your favorite text editor
  3. Add a link to a CSS file in your home directory (and anything else you might want). I put mine in ~/Library/Application Support/iA Writer/themes/policus/css/styles.css and decided to load a couple of web fonts from Google. See hacked-htmlTemplate.html later this gist.
  4. Save, exit
  5. Create the CSS file, override default Writer styles

Now when you export to HTML from inside of Writer, your HTML file will be styled according to your your overrides. Want to share your pretty docs? Print to PDF.

Next steps: Link to a locally-hosted jQuery and write a little JS app for switching themes in browser.

@CHH
CHH / .gitignore
Created August 2, 2011 21:09
PHP Templating Engine with bindable $this support in 53 LOC
vendor/
composer.lock
@senko
senko / onchange.sh
Last active July 14, 2023 07:54
OnChange - Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@lg0
lg0 / markdown.xml
Created April 10, 2012 19:58
Markdown Syntax Highlighting for Sublime text 2
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@mauryaratan
mauryaratan / htaccess-tweaks
Created May 7, 2012 13:43
htaccess Gzip Compression and expires to speed up page load time
<IfModule mod_deflate.c>
#The following line is enough for .js and .css
AddOutputFilter DEFLATE js css
AddOutputFilterByType DEFLATE text/plain text/xml application/xhtml+xml text/css application/xml application/rss+xml application/atom_xml application/x-javascript application/x-httpd-php application/x-httpd-fastphp text/html
#The following lines are to avoid bugs with some browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@krakjoe
krakjoe / demo.php
Last active December 2, 2016 05:28
PCNTL+pools+workers+pthreads
<?php
declare(ticks=1);
/*
This is your container for workers, it is only used in the process itself, so there is no need to descend from pthreads
*/
class Pool {
public $max;
public $config;
public $stop;
@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@tmatilai
tmatilai / Vagrantfile
Last active January 1, 2021 19:49
My global Vagrant configuration (~/.vagrant.d/Vagrantfile)
# URI of the local (caching) HTTP proxy
LOCAL_HTTP_PROXY = 'http://192.168.33.200:8123'
# Configures vagrant-cachier and vagrant-proxyconf.
# Should be called only on "local machine" providers.
def configure_caching(config)
if Vagrant.has_plugin?('vagrant-cachier')
config.cache.enable_nfs = true
config.cache.enable :gem
config.cache.enable :npm