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
{
// Theme and Color Scheme
// Color Scheme: Tomorrow Night – https://github.com/chriskempson/tomorrow-theme
// Theme: Soda – https://github.com/buymeasoda/soda-theme/
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"theme": "Soda Dark 3.sublime-theme",
"soda_classic_tabs": true, // Classic tabs instead of boxy tabs
"soda_folder_icons": true, // Folders in the sidebar, instead of arrows
// Typeface and Typesetting
@cdl
cdl / colorjs.js
Last active December 30, 2015 16:09
// colorjs.js
// @description An implementation of how I did the color changing background
// on my site. Essentially, I'm using the HSLA color space because
// it makes it really easy to control the general lightness of a
// color and maintain it throughout a bunch of hues. For instance:
// take a look at http://cl.ly/SrT1. Notice how all the colors
// have the same contrast? That's because all that's changed between
// them is the hue values. That's what we're replicating here.
//
// @requirements jQuery –– http://jquery.com/
// blah blah pretend this is in a method and someText is a
// UILabel that's in self or something
[[self someItem] setText:@"This is some text"];
// orrrrrr
self.someItem.text = @"This is some text";
@cdl
cdl / gist:8468023
Last active January 3, 2016 13:09
answerLabel = [[UILabel alloc] initWithFrame:CGRectMake(35.0f, 132.0f, 260.0f, 54.0f)];
answerLabel.font = [UIFont fontWithName:@"AvenirNext-DemiBold" size:45.0f];
answerLabel.textAlignment = NSTextAlignmentRight;
answerLabel.numberOfLines = 1;
answerLabel.minimumScaleFactor = 8./answerLabel.font.labelFontSize;
answerLabel.text = @"BASKETBALL";
/*
* Failing on line 7 - error:
@cdl
cdl / pocket-wat.m
Created March 3, 2014 19:39
For some reason this doesn't seem to be deleting things from my Pocket account.
// Unsave from Pocket
// self.heldStoryPocketID – item ID for the story grabbed from the Pocket API
NSError *error;
NSArray *actions = @[@{@"action": @"delete", @"item_id": self.heldStoryPocketID}];
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:actions options:kNilOptions error:&error];
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSDictionary *argDictionary = @{@"actions": jsonString};
// self.heldStoryPocketID – NSString containing the integer of the Pocket item ID grabbed from the API
NSError *error;
NSArray *actions = @[@{@"action": @"delete", @"item_id": self.heldStoryPocketID}];
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:actions options:kNilOptions error:&error];
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSDictionary *args = @{@"actions": jsonString};
[[PocketAPI sharedAPI] callAPIMethod:@"send" withHTTPMethod:PocketAPIHTTPMethodPOST arguments:args handler:^(PocketAPI *api, NSString *apiMethod, NSDictionary *response, NSError *error) {
if (error) {
str = "On a boredom scale of 1-10, I am: "
puts str + str.length
#include <stdio.h>
main() {
char str[] = "On a boredom scale of 1-10, I am: ";
printf("%s %i", str, strlen(str));
}
NSString *str = @"On a boredom scale of 1-10, I am:";
NSLog(@"%@ %lu", str, str.length);
{
"color_scheme": "Packages/Dayle Rees Color Schemes/sublime/peel.tmTheme",
"font_face": "Inconsolata",
"font_size": 16,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 4,
"line_padding_top": 4,