footer: Nordic Ruby | @raganwald slidenumbers: true
^ © 2016 Reginald Braithwaite. Some rights reserved.
| # Byte-compiled / optimized / DLL files | |
| __pycache__/ | |
| *.py[cod] | |
| # C extensions | |
| *.so | |
| # Distribution / packaging | |
| .Python | |
| env/ |
| mport datetime | |
| import mongoengine | |
| from invoicing.const import DATE_FORMAT | |
| black_listed_fields = [ | |
| "auth_token", "avatar", "deleted_at", "google_id", "last_login_at", "password" | |
| ] |
footer: Nordic Ruby | @raganwald slidenumbers: true
^ © 2016 Reginald Braithwaite. Some rights reserved.
| /** | |
| * JavaScript Client Detection | |
| * (C) viazenetti GmbH (Christian Ludwig) | |
| */ | |
| (function (window) { | |
| { | |
| var unknown = '-'; | |
| // screen |
| import os | |
| from shutil import * | |
| rootdir = '/Users/jineshn/tools/Images.xcassets' | |
| for subdir, dirs, files in os.walk(rootdir): | |
| for file in files: | |
| fn = os.path.join(subdir, file) | |
| print fn | |
| copyfile(fn, '/Users/jineshn/tools/output/'+file) |
| ------------------------------------------------------------------------------------- | |
| // using alamofire | |
| Alamofire.request(.GET, Constants.Keys.BASE_URL+"/giftcards", headers: header, encoding: .JSON).validate().responseJSON() { response in | |
| if let error = response.result.error { | |
| self.fetchFailure(error.code, errorBody: error.description) | |
| return | |
| } | |
| let json = JSON(response.result.value!) |
| var v : Int = 0 { | |
| didSet{ | |
| print("didSet called \(v)") | |
| } | |
| willSet(newValue){ | |
| if (newValue != v){ | |
| print("value changed") | |
| } else { | |
| print("value not changed") | |
| } |
| import os | |
| import sys | |
| import json | |
| import math | |
| import urllib | |
| import urllib2 | |
| def find_coords(address): | |
| """ |
| # login in to gcloud instance | |
| gcloud compute --project "lda-cis" ssh --zone "us-central1-f" "instance-1" | |
| gcloud compute --project "lda-cis" ssh --zone "us-central1-f" "instance-2" | |
| # scp in gcloud | |
| gcloud compute --project "lda-cis" copy-files --zone "us-central1-f" "instance-1":/home/rajareddykarri/enwiki-20150805-pages-articles.xml.bz2 . |
| # -*- coding: utf-8 -*- | |
| #============================================================================== | |
| # Name: pubsub | |
| # | |
| # Purpose: Simple publish & subscribe in pure python | |
| # | |
| # Author: Zhen Wang | |
| # | |
| # Created: 23 Oct 2012 | |
| # Copyright: |