Skip to content

Instantly share code, notes, and snippets.

View mtheoryx's full-sized avatar
🐳
Making happy little clouds

David Poindexter mtheoryx

🐳
Making happy little clouds
View GitHub Profile
@pbjorklund
pbjorklund / avdi_vcr_screencast_transcription
Created January 20, 2012 10:18
Transcript of avdi's vcr screencast
http://avdi.org/devblog/2011/04/11/screencast-taping-api-interactions-with-vcr/
== What is it
Testing web apps. Modern web apps are more often then not interconnected and talking with at least one RESTful api. These can be social networking sites, url shorteners, payment gateways etc.
This presents an interesting problem when it comes to high level integration testing. There are a few different approaches to testing on this level.
* Live testing - Talking directly to external sources
Slow, makes continuous integration a pain
Dependant on the services, can be in maintenance mode
@mrpunkin
mrpunkin / arel_based.rb
Created March 7, 2012 21:47
Using arel to query SQL functions
dc = Arel::Nodes::NamedFunction.new "DATE", [ p[:created_at] ] ## second argument must be an array
## Sub this...
arel.project("DATE(`photos`.`created_at`)")
## For this...
arel.project(dc.to_sql)
arel.to_sql >> "SELECT DATE(`photos`.`created_at`) FROM `photos` INNER JOIN `votes` ON `photos`.`id` = `votes`.`photo_id`"
@mpapis
mpapis / gist:2142642
Created March 20, 2012 23:48 — forked from mtheoryx/gist:2142561
bash echo rvm current, reusable
rvm current | awk -F '[@-]' '{print $2"-"$3}'
@ilguzin
ilguzin / idea.vmoptions
Last active March 21, 2022 14:46
High performance Mac OS X IntelliJ IDEA options: /Applications/IntelliJ IDEA 12 CE.app/bin/idea.vmoptions
-server
-Xms512m
-Xmx2048m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=256m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC
-XX:+AggressiveOpts
-XX:+CMSClassUnloadingEnabled
@Andrew-Max
Andrew-Max / gist:305483febc3c367dbf57
Last active June 13, 2022 07:55
Route lifecycle hooks guide from Ember meetup lightning talk
App.LibraryRoute = App.ApplicationRoute.extend({
activate: function () {
//no longer enter
this._super();
only called once on entering a route.
},
beforeModel: function () {
// any state you want in place before the model is initialized, this is called before any model promises are resolved
// also could be used to conditionally prevent access to a route by throwing transition.abort
@siteshen
siteshen / slack_client.sh
Created January 17, 2015 04:54
Slack client in bash
#!/bin/bash
# https://your-team.slack.com/services/new/incoming-webhook
WEBHOOK_URL=''
CHANNEL='#dev'
USERNAME='sentry'
iCON_URL='https://slack.global.ssl.fastly.net/17635/img/services/sentry_128.png'
function post_message() {
payload="{'username': '$USERNAME', 'text': '$AT_USER $1', 'channel': '$CHANNEL', 'icon_url': '$ICON_URL'}"
@duvillierA
duvillierA / doc.md
Last active June 2, 2016 19:46
How to Migrate an Ember.js 1.8.1 stack to 1.10.0 with HTMLBars on Grunt

Breaking changes


Dependencies

Dependency Version New Version Package manager
ember 1.8.1 1.10.0 Bower
ember-resolver 0.1.11 0.1.12 Bower
ember-data 1.0.0-beta.12 1.0.0-beta.14.1 Bower
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@wassname
wassname / natural-webpack.js
Created April 3, 2016 09:16
Importing natural into webpack (the node nlp toolkit)
/*
Importing natural into webpack (the node nlp toolkit)
This is just copy of natural's index.js with some exports commented out.
This way it works in webpack, however I haven't full tested it.
*/
exports.SoundEx = require('natural/lib/natural/phonetics/soundex');
exports.Metaphone = require('natural/lib/natural/phonetics/metaphone');
exports.DoubleMetaphone = require('natural/lib/natural/phonetics/double_metaphone');