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
defmodule MyApp.User do | |
use MyApp.Web, :model | |
schema "users" do | |
field :email, :string | |
field :encrypted_password, :string | |
field :is_admin, :boolean, default: false | |
field :password, :string, virtual: true | |
timestamps |
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
Show hidden characters
{ | |
"extends": "eslint:recommended", | |
"parserOptions": { | |
"ecmaVersion": 6, | |
"sourceType": "module", | |
"ecmaFeatures": { | |
"jsx": true | |
} | |
}, | |
"env": { |
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
server { | |
listen 443 ssl; | |
server_name example.com; | |
keepalive_timeout 70; | |
ssl_certificate crt.crt; | |
ssl_certificate_key key.key; | |
ssl_prefer_server_ciphers on; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers kEECDH+AESGCM+AES128:kEECDH+AES128:kRSA+AESGCM+AES128:kRSA+AES128:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv2; |
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
from itertools import product | |
def string_range(first, last): | |
""" | |
Generates string range, analog of Perl's `print "a".."azc"` | |
Usage: string_range('a', 'azc') | |
""" | |
def ascii_generator(letters): | |
""" |
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
#!/bin/zsh | |
# my favorite apps to use | |
export EDITOR='/opt/local/bin/vim' | |
export BROWSER='open' # can be replaced by firefox or smt on Linux | |
# completion | |
fpath=(~/.zshfuncs $fpath) | |
autoload -U compinit | |
compinit |
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
""" | |
This fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
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
package haven; | |
import static haven.MCache.cmaps; | |
import static haven.MCache.tilesz; | |
import java.security.*; | |
import java.util.*; | |
import java.net.*; | |
import java.io.*; | |
import java.awt.image.BufferedImage; | |
import javax.imageio.ImageIO; |
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
import glob | |
import os | |
from PIL import Image | |
class MapRow(dict): | |
def __init__(self, map_obj, x_coord, *args, **kwargs): | |
super(MapRow, self).__init__(self, *args, **kwargs) | |
self.map = map_obj |
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
Method (_DSM, 4, NotSerialized) | |
{ | |
Store (Package (0x0A) | |
{ | |
"built-in", | |
Buffer (One) | |
{ | |
0x01 | |
}, |
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
Device (SATA) | |
{ | |
Name (_ADR, 0x001F0002) | |
Method (_DSM, 4, NotSerialized) | |
{ | |
Store (Package (0x02) | |
{ | |
"device-id", | |
Buffer (0x04) | |
{ |