This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'digest/md5' | |
| def gfm(text) | |
| # Extract pre blocks | |
| extractions = {} | |
| text.gsub!(%r{<pre>.*?</pre>}m) do |match| | |
| md5 = Digest::MD5.hexdigest(match) | |
| extractions[md5] = match | |
| "{gfm-extraction-#{md5}}" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # on ubuntu: need some utils & dev libs | |
| sudo apt-get install apache2-utils openssl libssl-dev libpcre3-dev | |
| # compile nginx | |
| cd /tmp | |
| curl http://nginx.org/download/nginx-0.7.64.tar.gz | tar xz | |
| cd nginx* | |
| ./configure --with-http_ssl_module --with-http_dav_module \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Wraps distcc compiler calls in ccache. | |
| # Install at /Developer/usr/bin. | |
| DISTCC=/usr/bin/distcc | |
| export CCACHE_PREFIX="$DISTCC" | |
| if [ "$1" == "--host-info" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| # Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs | |
| # License: See below. | |
| # http://gist.github.com/507356 | |
| use strict; | |
| use warnings; | |
| use URI::Escape; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set now to (do shell script "date '+%Y-%m-%d-%H-%M-%S'") as string | |
| set home to (path to home folder) as string | |
| set filename to home & "Dropbox:notesy:New Note " & now & ".txt" | |
| set snippet to the clipboard as «class utf8» | |
| set fd to open for access filename with write permission | |
| write snippet to fd as «class utf8» | |
| close access fd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| In Gitbox (gitboxapp.com) there is a stage view on the right where you can see | |
| a list of all the changes in the working directory: untracked, modified, | |
| added, deleted, renamed files. Each change has a checkbox which you can click | |
| to stage or unstage the change ("git add", "git reset"). | |
| When the change staging finishes, we run another task to load all the changes | |
| ("git status"). | |
| When the loading task is completed we notify the UI to update the list of changes. | |
| All tasks are asynchronous. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Mac OS X | |
| *.DS_Store | |
| # Xcode | |
| *.pbxuser | |
| *.mode1v3 | |
| *.mode2v3 | |
| *.perspectivev3 | |
| *.xcuserstate | |
| project.xcworkspace/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby -wKU | |
| # Adapted from Brett Terpstra’s original “Markdown to Evernote” service (http://brettterpstra.com/a-better-os-x-system-service-for-evernote-notes-with-multimarkdown/) | |
| # Martin Kopischke 2011 – License: Creative Commons Attribution Share-Alike (CC BY-SA) 3.0 Unported (http://creativecommons.org/licenses/by-sa/3.0/) | |
| # Changes: – create only one Evernote note per (Multi)Markdown input passed (instead of one per line) | |
| # – do not choke on shell escape characters (use Tempfile instead of shell pipe for osascript) | |
| # – default to MultiMarkdown 3 executable (instead of MMD 2 Perl script) | |
| # – make smart typography processing optional (set SMARTY to 'false' to bypass processing; | |
| # note smart typography cannot be disabled in MMD 3.0 and 3.0.1 | |
| # – handle both smart typography processing scripts (ie. SmartyPants.pl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This file contains custom input method from formtastic 1.2 and their | |
| # replacement classes in 2.0 | |
| module FormtasticExtensions | |
| class WysiwygInput < Formtastic::Inputs::TextInput | |
| def input_html_options | |
| wysiwyg_type = input_options.delete(:controls) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Regular expression include, slash escape test | |
| // @namespace https://github.com/arantius | |
| // @include /^https://gist.github.com// | |
| // ==/UserScript== | |
| GM_addStyle('body, #main { background-color: green !important; }'); |
OlderNewer