Skip to content

Instantly share code, notes, and snippets.

View chrisladd's full-sized avatar

Chris Ladd chrisladd

View GitHub Profile
@chrisladd
chrisladd / Storing-Images-On-Github.md
Created February 13, 2020 18:15 — forked from joncardasis/Storing-Images-On-Github.md
Storing Images and Demos in your Repo

Storing Images and Demos in your Repo

In this quick walkthough you'll learn how to create a separate branch in your repo to house your screenshots and demo gifs for use in your master's readme.

How to

1. Clone a fresh copy of your repo

In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.

2. Create a new branch

Create a new branch in your repo by using git checkout --orphan assets

{
"feedUrl": "http://www.nasa.gov/rss/dyn/lg_image_of_the_day.rss",
"title": "NASA Image of the Day",
"link": "http://www.nasa.gov/",
"author": "",
"description": "The latest NASA \"Image of the Day\" image.",
"type": "rss20",
"entries": [
{
"title": "Jarosite in the Noctis Labyrinthus Region of Mars",
@chrisladd
chrisladd / text.js
Created February 9, 2016 19:56
Text Rendering for Sketch
// text.js
function replaceSubstring(inSource, inToReplace, inReplaceWith) {
var outString = inSource;
while (true) {
var idx = outString.indexOf(inToReplace);
if (idx == -1) {
break;
}
@chrisladd
chrisladd / generate_readme.rb
Created April 14, 2015 16:21
A simple little script I use to keep the readme for my local podspecs up to date.
#!/usr/bin/env ruby
puts ''
puts 'Generating README...'
readme = ''
specs = Dir.glob('./*').select { |fn| File.directory?(fn) }
summaryRegEx = /\s*s.summary\s*=\s*\"(.*)\"/
@chrisladd
chrisladd / LYLPickyArray.h
Last active August 29, 2015 14:18
A picky array to satisfy Loyal
//
// LYLPickyArray.h
//
// Copyright (c) 2015 NYTimes. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface LYLPickyArray : NSMutableArray
@chrisladd
chrisladd / UA-Rocket-Launch-Output
Created October 8, 2014 04:23
Write a Java class called "RocketLaunch" to produce the following output. Use nested for loops for the countdown. Define at least three methods: printCountdown(), printRocket(), and printFlame().
Prepare for launch!
9 minutes and 59 seconds.
9 minutes and 58 seconds.
9 minutes and 57 seconds.
9 minutes and 56 seconds.
9 minutes and 55 seconds.
9 minutes and 54 seconds.
9 minutes and 53 seconds.
9 minutes and 52 seconds.
9 minutes and 51 seconds.
@chrisladd
chrisladd / ua-assembly-for-loops
Created September 29, 2014 19:57
ua-assembly-for-loops
public class ForLoops {
public static void main(String[] args) {
for (int i = 99; i >= 0; i = i - 1) {
System.out.println(i + " bottles of root beer on the wall.");
}
// compound interest means that you make a certain amount of money
public class ForLoops {
public static void main(String[] args) {
for (int i = 99; i >= 0; i = i - 1) {
System.out.println(i + " bottles of root beer on the wall.");
}
@chrisladd
chrisladd / BasicCoreDataSearchImplementation.m
Created March 19, 2014 16:48
Some very old code implementing basic search split on words. Don't judge.
-(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
NSMutableSet *uniqueCharts = [NSMutableSet set];
NSMutableCharacterSet *charSet = [[NSMutableCharacterSet alloc] init];
[charSet formUnionWithCharacterSet:[NSCharacterSet punctuationCharacterSet]];
[charSet formUnionWithCharacterSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSArray *words = [searchText componentsSeparatedByCharactersInSet:charSet];