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
'use strict'; | |
var webpack = require('webpack'); | |
var path = require('path'); | |
module.exports = { | |
entry: './src/game.js', | |
output: { | |
filename: 'build/game.js' | |
}, |
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
{ | |
"61505": "Α", | |
"61506": "Β", | |
"61507": "Χ", | |
"61508": "Δ", | |
"61509": "Ε", | |
"61510": "Φ", | |
"61511": "Γ", | |
"61512": "Η", | |
"61513": "Ι", |
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 load_obj(file): | |
vertices = [] | |
lines = [] | |
with open(file, 'r') as f: | |
for line in f: # loop over lines in file | |
if line[0] == 'v': # lines starting with 'v' is a vertex | |
vertices.append([float(x) for x in line.split(' ')[1:]]) # split on spaces, skip first character (v) | |
elif line[0] == 'f': # face (4 points) | |
i = 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
function run() { | |
// Quit | |
var safari = Application('Safari'); | |
safari.activate(); | |
safari.quit() | |
// Reopen safari | |
safari.activate(); | |
// Get menu |
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
@-moz-document domain(tweetdeck.twitter.com) { | |
.app-columns { | |
display: flex; | |
flex-flow: row wrap; | |
} | |
.column { | |
flex: 1 20% !important; | |
height:50% !important; | |
} |
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
// Put this in your router.go | |
// I wasn't able to find any settings for this in Beego, so I created this middleware. | |
import "strings" | |
beego.InsertFilter("*", beego.BeforeExec, func(ctx *context.Context) { | |
path := ctx.Request.URL.Path | |
if path[len(path)-1] != '/' && strings.Index(path, "/static/") != 0 { | |
ctx.Redirect(301, 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
# Based on http://www.chris-reilly.org/blog/technotes/macbook-trackpad-in-ubuntu/ | |
Section "InputClass" | |
MatchIsTouchpad "on" | |
Identifier "Touchpads" | |
Driver "mtrack" | |
Option "Sensitivity" "0.55" | |
Option "FingerHigh" "12" | |
Option "FingerLow" "1" | |
Option "IgnoreThumb" "true" |
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 crypt | |
// #cgo LDFLAGS: -lcrypt | |
// #include <stdlib.h> | |
// #include <crypt.h> | |
import "C" | |
import "unsafe" | |
func Crypt(key, salt string) string { | |
cKey := C.CString(key) |
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 std.stdio; | |
import std.uni; | |
import std.ascii; | |
import std.string; | |
import std.algorithm; | |
import std.range; | |
string slugify(string text) { | |
text = normalize!NFKD(text); | |
auto slug = ""; |
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
# sqlite.conf | |
dbpath /mail/mail.db | |
query_alias select value from aliases where key=?; | |
query_domain select domain from domains where domain=?; | |
query_userinfo select uid, gid, directory from users where user=?; | |
query_credentials select key, value from credentials where key=?; | |
query_netaddr select value from netaddr where value=?; | |