CIAccordionFoldTransition
CIAdditionCompositing
CIAffineClamp
CIAffineTile
CIAffineTransform
CIAreaAverage
CIAreaHistogram
This file contains hidden or 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
class Router { | |
constructor(){ | |
const path = (window.location.href.split("/#!")[1]) | |
?(window.location.href.split("/#!")[1]) | |
:(window.location.href.split(/src\/html/)[1]) | |
// callbacks | |
this.actions = [] | |
this.state = { | |
baseURL: window.location.protocol+"://"+window.location.host, | |
path: path, |
This file contains hidden or 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
package main | |
import ( | |
"net" | |
) | |
func main(){ | |
message := []byte("Hello world") | |
localAddress, _ := net.ResolveUDPAddr("udp", "127.0.0.1:0") | |
remoteAddress, _ := net.ResolveUDPAddr("udp", "127.0.0.1:1936") |
This file contains hidden or 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 | |
import Darwin | |
func htons(value: CUnsignedShort) -> CUnsignedShort { | |
return (value << 8) + (value >> 8) | |
} | |
let INADDR_ANY = in_addr(s_addr: 0) |
This file contains hidden or 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
# | |
# Print in one line dynamically | |
# | |
from sys import stdout | |
from time import sleep | |
def progress(): | |
for i in range(0,100): | |
stdout.write('\rLoading {}%'.format(i+1)) | |
stdout.flush() |
This file contains hidden or 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
import os | |
import socket | |
videos = [] | |
client = socket.socket() | |
client.connect((socket.gethostbyname('localhost'), 3000)) | |
# Append the video files paths into array | |
def load_videos(): | |
base_dir = os.path.dirname(os.path.realpath(__file__)) |
This file contains hidden or 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
# | |
# web/models/user.ex | |
# | |
defmodule Plans.User do | |
use Plans.Web, :model | |
@primary_key {:id, :binary_id, autogenerate: true} | |
schema "users" do | |
field :username, :string | |
field :email, :string |
This file contains hidden or 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
content, err = ioutil.ReadFile("templates/rss.xml") | |
if err != nil { | |
panic(err) | |
} | |
//Custom template helpers | |
fm := template.FuncMap{"number": func(n int) string { | |
return strconv.Itoa(n) | |
}, "float": func(f float64) string { | |
return strconv.FormatFloat(f, 'f', -1, 64) |
This file contains hidden or 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
def generate_name do | |
# [[64][64]] | |
[["autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark", | |
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter", | |
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue", | |
"billowing", "broken", "cold", "damp", "falling", "frosty", "green", | |
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old", | |
"red", "rough", "still", "small", "sparkling", "throbbing", "shy", | |
"wandering", "withered", "wild", "black", "young", "holy", "solitary", | |
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine", |
This file contains hidden or 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
package main | |
import ( | |
"os" | |
"log" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
"time" | |
) |