Skip to content

Instantly share code, notes, and snippets.

View cdl's full-sized avatar
💭
I may be slow to respond.

Colby Ludwig cdl

💭
I may be slow to respond.
View GitHub Profile
+ (void)didFireClassMethod:(NSString *)arg1 withString:(NSString *)string;
Colbys-MacBook:Tuner rockets$ git push origin master
Counting objects: 35, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (20/20), 21.71 KiB, done.
Total 20 (delta 4), reused 0 (delta 0)
error: RPC failed; result=52, HTTP code = 0
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
@cdl
cdl / gist:6265427
Last active December 21, 2015 06:39
I really want this to be a thing in CSS.
CSS:
.link-$service {
background-image: url("img/$service.png");
}
HTML:
<a href="#" class="link-twitter">link</a>
var m = [20, 120, 20, 120],
w = 1280 - m[1] - m[3],
h = 800 - m[0] - m[2],
i = 0,
root;
var tree = d3.layout.tree()
.size([h, w]);
sudo apt-get update
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
// Here's what I'm trying to achieve:
//
// - if an element has the class "small-rm", remove any classes that begin with "small-" from it
// - if an element has the class "pull-rm", remove any classes that begin with "pull-" from it
//
$(".small-rm").removeClass("[class^='small-']");
$(".pull-rm").removeClass("[class^='pull-']");
// Should this not work?
app.get('/callback', function(req, res) {
var code = req.param('code');
var request = require('request');
var body = 'client_id=REDACTED&client_secret=REDACTED&grant_type=authorization_code&redirect_uri=http://textr.dev/callback';
var auth_request = request.post({
uri: 'https://account.app.net/oauth/access_token',
body: body,
headers: {
'Content-Length': body.length
}
@cdl
cdl / mashable.js
Created September 19, 2013 14:57
Reverse engineering the Mashable Velocity graph. Pasting their JS here for archival purposes.
function google_ad_request_done(t) {
var e, n = "";
if (0 !== t.length) {
if ("flash" == t[0].type) n += '<a href="' + google_info.feedback_url + '">Ads by Google</a><br>' + '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' + google_ad.image_width + '" HEIGHT="' + google_ad.image_height + '"> <PARAM NAME="movie" VALUE="' + google_ad.image_url + '">' + '<PARAM NAME="quality" VALUE="high">' + '<PARAM NAME="AllowScriptAccess" VALUE="never">' + '<EMBED src="' + google_ad.image_url + '" WIDTH="' + google_ad.image_width + '" HEIGHT="' + google_ad.image_height + '" TYPE="application/x-shockwave-flash"' + ' AllowScriptAccess="never" ' + ' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
else if ("image" == t[0].type) n += '<a href="' + google_info.feedback_url + '">Ads by Google</a><br> <a href="' + t[0].url + '" target="_top" title="go to ' + t[
@cdl
cdl / ex1.scss
Created September 28, 2013 19:17
// main.scss
@import 'vars';
@import 'icing/icing';
// _vars.scss;
$main-typeface: 'proxima-nova';
$heading-typeface: 'proxima-nova-cond';
$pullquote-typeface: 'proxima-nova-cond';
<div class="large-2">
<h4 class="empha-desc">When?</h4>
<div class="date-block">
<p class="date-day">16</p>
</div>
<p class="date-month">October</p>
<p class="date-year">2013</p>
<p class="date-time">5:30 - 7 PM</p>
</div>