Skip to content

Instantly share code, notes, and snippets.

View NicholasTD07's full-sized avatar

Nicholas T. NicholasTD07

  • Sydney, Australia
View GitHub Profile
@NicholasTD07
NicholasTD07 / vundle-with-bootstrap.vim
Created January 14, 2015 00:01
Minimum Vundle Setup with Bootstrap
" To test this file in isolation,
" put it in a folder other then ~/,
" then run 'vim -u vundle-with-bootstrap.vim'.
set nocompatible
filetype off
" modified bootstrap, originally by John Whitley
" https://github.com/jwhitley/vimrc/blob/master/.vim/bootstrap/bundles.vim
var arr = [ "one", "two", "three", "four", "five" ];
jQuery.each(arr, function(index, value) {
console.log(this);
return (this != "three"); // will stop running after "three"
});
$("<input/>", {
id: "permissionsInput",
name: "permissions",
type: "checkbox",
click: function(){
update();
},
checked: "checked"
}).appendTo("#myForm");
# Using this script downloads ALL the videos in NSScreencast.
# Use it wisely, it's extra load/bandwidth for the NSScreencast website.
# Usage: `EMAIL=your email PASSWORD=your password END=how many videos should be downloaded? ruby download-nsscreencast.rb`
require "mechanize"
require "parallel"
mechanize = Mechanize.new
mechanize.post("https://www.nsscreencast.com/user_sessions", {"email" => ENV["EMAIL"], "password" => ENV["PASSWORD"]})
mechanize.pluggable_parser.default = Mechanize::Download
@NicholasTD07
NicholasTD07 / argo-enxtenison.swift
Last active August 29, 2015 14:22
Argo extension example
import Argo
let json = [
"urlString": "http://www.example.com",
"timestamp": 1433132865,
"date": "20150525",
"intString": "12345",
]
struct ExampleModel {
@NicholasTD07
NicholasTD07 / protocol-as-parameter.swift
Created June 8, 2015 05:52
Swift protocol as parameter for both class and struct.
protocol Named: class {
var name: String { get set }
}
class Person: Named {
var name: String
init(name: String) {
self.name = name
}
@NicholasTD07
NicholasTD07 / Argo-decode-classes.swift
Last active August 29, 2015 14:22
Argo doesn't work with subclass (Swift 1.2 AND 2.0)
import XCTest
import Argo
import Runes
class SuperClass {
let something: String
init(something: String) {
self.something = something
}
" For Vundle, uncomment next line
" Plugin 'Lokaltog/vim-easymotion'
" easymotion
let g:EasyMotion_smartcase = 1 " turn on case insensitive feature
let g:EasyMotion_do_mapping = 0 " disable default mappings
let g:EasyMotion_use_smartsign_us = 1 " 1 will match 1 and !
let g:EasyMotion_use_upper = 1
let g:EasyMotion_keys = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ;'
@NicholasTD07
NicholasTD07 / Branch base point after release branch exist.md
Last active August 29, 2015 14:24
Swift ZHI - Development Notes

Branch base point after release branch exists

git merge-base develop release/Xcode-6.3.2-Swift-1.2

It gives the commit before develop and release/ start to differentiate.

WHY?

@NicholasTD07
NicholasTD07 / clean-up-simulators.sh
Created July 15, 2015 04:26
Remove all unavailable iOS simulators
#!/bin/sh
# "Delete all unavailable devices."
xcrun simctl delete unavailable