This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DomRenderer = class { | |
constructor(list, parent) { | |
this._parent = parent; | |
this._list = list; | |
this._sort = 'title'; | |
} | |
add(parent, title, date) { | |
parent.add(new TaskItem(title, date)); | |
this.render(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Github = class { | |
constructor(id, repo) { | |
this._base = `https://api.github.com/repos/${id}/${repo}/contents/`; | |
} | |
load(path) { | |
if (!this._parser) return; | |
const id = 'callback' + Github._id++; | |
const f = Github[id] = ({data:{content}})=>{ | |
delete Github[id]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Github = class { | |
constructor(id, repo) { | |
this._base = `https://api.github.com/repos/${id}/${repo}/contents/`; | |
} | |
load(path) { | |
if (!this._parser) return; | |
const id = 'callback' + Github._id++; | |
const f = Github[id] = ({data:{content}})=>{ | |
delete Github[id]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Playground - noun: a place where people can play | |
import Cocoa | |
extension String { | |
func dictionaryFromJSON () -> Dictionary<String, AnyObject>? { | |
do { | |
if let data = self.data(using: .utf8), let dict = try JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions.allowFragments) as? [String: AnyObject] { | |
return dict | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)rotateLabelUp { | |
[UIViewanimateWithDuration:0.5 animations:^{ | |
_label.transform = CGAffineTransformMakeRotation(0); | |
} completion:^(BOOL finished){ | |
[selfrotateLabelDown]; | |
}]; | |
} | |
- (void)rotateLabelDown { | |
[UIViewanimateWithDuration:0.5 animations:^{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LinkedList { | |
private Node head; | |
public LinkedList () { | |
} | |
public void addNode (Node newNode) { | |
if (head == null) { | |
head = newNode; | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Upstream to abstract backend connection(s) for php | |
upstream php { | |
server unix:/var/run/php5-fpm.sock; | |
} | |
server { | |
## Your only path reference. | |
root /var/www/wordpress; | |
listen 80; |