Skip to content

Instantly share code, notes, and snippets.

View gazoombo's full-sized avatar

Mike English (old) gazoombo

View GitHub Profile
@ELLIOTTCABLE
ELLIOTTCABLE / gist:1176410
Created August 28, 2011 08:25
How Twitter replies *acutally work*. With proof.
<+elliottcable> fotoverite ⁓ Basically, there’s two situations in which a tweet from @A will not show up to
                person @C, who follows @A
<+elliottcable> 1. if the tweet *starts* with an @ character as the very first character, followed by at
                least one legal username character
<+elliottcable> 2. if the tweet is marked as a “reply̦” to another tweet, with the in_reply_to_status_id
                property
<+elliottcable> now, neither of the above apply *if* @A is *also* following the third person, @B (for
                instance, if the tweet *started* with @B, or if the in_reply_to_status_id was a tweet by @B.)
<+elliottcable> That is the *entirety of how it works*.

<+elliottcable> It’s a very long-standing belief that if you stick something before the @ at the start of a

@tskrynnyk
tskrynnyk / Makefile
Created June 26, 2011 11:34
Pandoc makefile
PANDOC = pandoc
%.html: %.md style.css Makefile
$(PANDOC) -c style.css -s -f markdown -t html --standalone -o $@ $<
%.odt: %.md Makefile
$(PANDOC) --standalone -f markdown -t odt -o $@ $<
%.epub: %.md Makefile
$(PANDOC) -o $@ $<
@bycpx
bycpx / config
Created October 13, 2010 19:07
Enable textual diff of iWork Pages documents.
[diff "iworkpages"]
textconv = xsltproc $GIT_DIR/Pages.xsl
diff --git a/config/initializers/_mongo.rb b/config/initializers/_mongo.rb
index 2764f97..88d21ec 100644
--- a/config/initializers/_mongo.rb
+++ b/config/initializers/_mongo.rb
@@ -2,10 +2,12 @@
# licensed under the Affero General Public License version 3. See
# the COPYRIGHT file.
+require "uri"
# How to set up your local development machine to use the Apigee Heroku addon
if ENV['APIGEE_TWITTER_API_ENDPOINT']
@@twitter_api = ENV['APIGEE_TWITTER_API_ENDPOINT']
else
# Get this value from Heroku.
# Once you have enabled the addon, boot up the 'heroku console' and run the following:
# puts ENV['APIGEE_TWITTER_API_ENDPOINT']
# this will spit out your correct api endpoint
@@twitter_api = "twitter-api.appXYZABC.apigee.com"
@ato
ato / debug.clj
Created December 9, 2009 11:42
Simpler debug-repl that works with unmodified Clojure
;; Inspired by George Jahad's version: http://georgejahad.com/clojure/debug-repl.html
(defmacro local-bindings
"Produces a map of the names of local bindings to their values."
[]
(let [symbols (map key @clojure.lang.Compiler/LOCAL_ENV)]
(zipmap (map (fn [sym] `(quote ~sym)) symbols) symbols)))
(declare *locals*)
(defn eval-with-locals
@jnunemaker
jnunemaker / gist:217362
Created October 24, 2009 04:07 — forked from lukesutton/gist:107966
example of warden with sinatra
Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
Warden::Manager.before_failure do |env,opts|
# Sinatra is very sensitive to the request method
# since authentication could fail on any type of method, we need
# to set it for the failure app so it is routed to the correct block
env['REQUEST_METHOD'] = "POST"
end
@henrik
henrik / .bashrc
Created December 3, 2008 17:56
Git branch and dirty state in Bash prompt.
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"