Skip to content

Instantly share code, notes, and snippets.

View Shilo's full-sized avatar

Shilo Shilo

View GitHub Profile
@Shilo
Shilo / NSString+XML.h
Last active December 22, 2015 03:19
Customizable string XML parser for NSString, NSMutableString, NSAttributedString, and NSMutableAttributedString.
//
// NSString+XML.h
// Customizable string XML parser for NSString, NSMutableString, NSAttributedString, and NSMutableAttributedString.
//
// Created by Shilo White on 8/31/13.
// Copyright (c) 2013 XIDA Design & Technik. All rights reserved.
//
#import <Foundation/Foundation.h>
@Shilo
Shilo / Perfect_Convo_With_Boss.txt
Created April 14, 2016 09:32
Perfect Conversation with Mr. Boss, AKA Benjamin.
Shilo: Benjamin! Benjamin! Benjamin! Benjamin! Benjamin! Benjamin! Boss! Boss! Boss! Leader! Leader! Leader! Master! Master! Master! Ben!
Ben! Ben! Ben! Benni! Benni! Benni! Benni! Benji! Benji! Benj! Benj! Benj!
Benjamin: What!?
Shilo: Hi! (Giggling and running out of the room)
https://www.youtube.com/watch?v=aOLxQGLJouI
create dummy images
curl -L "http://dummyimage.com/600x400/000/fff&text=DummyImage%20[01-10]" -o image_#1.png
get page headers
curl --head http://google.com
send parameters to page
curl.exe -L -G "http://yoururl.com" --data-urlencode "text=DESIGN6 daily backup started"
send formdata & files to page
@Shilo
Shilo / defaults.sh
Last active June 12, 2016 17:18
OS X Useful Terminal Commands
//Disable app nap system-wide (Requires Restart)
defaults write NSGlobalDomain NSAppSleepDisabled -bool YES
//Finder show hidden files
defaults write com.apple.finder AppleShowAllFiles YES; killall Finder
//Desktop hide icons
defaults write com.apple.finder CreateDesktop false; killall Finder
//TextEdit open new document by default (Requires restart of TextEdit)
@Shilo
Shilo / filename_append_2x.sh
Created July 16, 2016 10:26
Terminal command to append "@2x" to file names inside current directory.
for file in *; do mv "$file" "${file%.*}@2x.${file##*.}"; done
@jamztang
jamztang / LICENSE
Created January 6, 2012 18:48
Creating a placeholder UIImage dynamically with color
Copyright (c) 2013 Jamz Tang <jamz@jamztang.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@Shilo
Shilo / NavigationController.m
Last active July 16, 2016 12:57
iOS - Dynamically load navigation bar title image with interpolation. How to use: Set navigation title as "{image_name_here}"
#define NAV_PORTRAIT_HEIGHT 44
- (void)viewDidLoad {
[super viewDidLoad];
[self loadNavigationBarTitleImage];
}
- (void)loadNavigationBarTitleImage {
NSString *title = self.navigationItem.title;
NSInteger prefixLength = NAV_TITLE_IMAGE_PREFIX.length;
@Shilo
Shilo / remove_svn_dirs.sh
Created October 24, 2013 05:34
Bash script command to recursively remove ".svn" directory from currently directory.
rm -rf `find . -type d -name .svn`
@Shilo
Shilo / svn_ignore.sh
Created September 6, 2016 03:08
Terminal command to add svn ignores via ".gitignore" file.
svn propset svn:ignore -RF .gitignore .
@dduan
dduan / NSAttributedString+SimpleHTMLTag.swift
Created December 7, 2014 05:59
Convert Simple Text With HTML Tags to NSAttributedString
extension NSAttributedString {
func replaceHTMLTag(tag: String, withAttributes attributes: [String: AnyObject]) -> NSAttributedString {
let openTag = "<\(tag)>"
let closeTag = "</\(tag)>"
let resultingText: NSMutableAttributedString = self.mutableCopy() as NSMutableAttributedString
while true {
let plainString = resultingText.string as NSString
let openTagRange = plainString.rangeOfString(openTag)
if openTagRange.length == 0 {