I hereby claim:
- I am danleyb2 on github.
- I am danleyb2 (https://keybase.io/danleyb2) on keybase.
- I have a public key ASA3TCNVO1kXk46ZlvZ4tMvEflADiA7hkKiHHHEqb8JD7Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import math | |
from math import pi | |
def points_on_circumference(center=(0, 0), r=50, n=100): | |
return [ | |
( | |
center[0]+(math.cos(2 * pi / n * x) * r), # x | |
center[1] + (math.sin(2 * pi / n * x) * r) # y |
@Singleton | |
public class DbHelper extends SQLiteOpenHelper { | |
//USER TABLE | |
public static final String USER_TABLE_NAME = "users"; | |
public static final String USER_COLUMN_USER_ID = "id"; | |
public static final String USER_COLUMN_USER_NAME = "usr_name"; | |
public static final String USER_COLUMN_USER_ADDRESS = "usr_add"; | |
public static final String USER_COLUMN_USER_CREATED_AT = "created_at"; | |
public static final String USER_COLUMN_USER_UPDATED_AT = "updated_at"; |
import os | |
# Helper settings for prj.settings | |
# SECURITY WARNING: don't run with debug turned on in production! | |
DEBUG = True | |
INSTANCE = '/tmp/mapping_app_instance/' | |
MEDIA_UPLOAD_ROOT = os.path.join(INSTANCE,'media') |
## 安裝語系檔 | |
`$ sudo locale-gen "en_US.UTF-8"` | |
## 重新設定語系檔 | |
`$ sudo dpkg-reconfigure locales` | |
## 設定檔 |
<?php | |
//edit with your data | |
$repo_dir = '~/repository.git'; | |
$web_root_dir = '~/project'; | |
$post_script = '~/project/scripts/post_deploy.sh'; | |
$onbranch = 'master'; | |
// A simple php script for deploy using bitbucket webhook | |
// Remember to use the correct user:group permisions and ssh keys for apache user!! | |
// Dirs used here must exists on server and have owner permisions to www-data |
# Each subdivision can go down to 127 levels deep, and each DNS label can contain up to 63 characters, | |
# as long as the whole domain name does not exceed a total length of 255 characters. | |
class SubdomainValidator < ActiveModel::EachValidator | |
def validate_each(object, attribute, value) | |
return unless value | |
reserved_names = %w[admin beta blog ftp imap mail pop pop3 sftp smtp ssl www] | |
reserved_names += options[:reserved] if options[:reserved] | |
object.errors[attribute] << 'cannot be a reserved name' if reserved_names.include?(value.downcase) |
// This mixin might be used to extend a class with or without its | |
// own "foo" method | |
const mixin = Base => class extends Base { | |
foo() { | |
// Only call super.foo() if it exists! | |
if (super.foo) { | |
super.foo(); | |
} | |
console.log('mixin'); |