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
| bower install --save angular-masonry --force-latest |
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
| arr = [10,20,15,2,23,90,67] | |
| def peakElement(arr): | |
| n=len(arr)-1 | |
| cur = 0 | |
| prev = cur - 1 | |
| nxt = 1 | |
| newarr = [] |
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
| ogrin | |
| gdal | |
| slippy_tile |
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
| #usr/bin/python | |
| #Decorators | |
| import json | |
| def as_json(func): | |
| def wrapper(*args,**kwargs): | |
| result = func(*args,**kwargs) | |
| return json.dumps(result) |
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
| #usr/bin/python | |
| #Decorators | |
| def decorator_func(original_function): | |
| def wrapper_func(): | |
| print('wrapper executed this before {}'.format(original_function.__name__)) | |
| return original_function() | |
| return wrapper_func |
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
| #usr/bin/python | |
| def currency(func): | |
| def wrapper(*args,**kwargs): | |
| return '$' + str(func(*args, **kwargs)) | |
| return wrapper | |
| @currency | |
| def price_with_tax(tax_rate_percentage): |
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
| li = [5,2,3,1,6,4] | |
| for i in range(1,len(li)): | |
| j = i | |
| while j > 0 and li[j] < li[j-1]: | |
| li[j], li[j-1] = li[j-1], li[j] | |
| print i,j,li | |
| j=j-1 |
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
| #usr/bin/python | |
| li = [5,2,3,1,6,4] | |
| for k in range(0,len(li)-1): | |
| j=1 | |
| for i in range(0,len(li)): | |
| if li[i] > li[j]: | |
| li[i],li[j] = li[j],li[i] | |
| if j == len(li)-1: |
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 requests | |
| import bs4 | |
| from apscheduler.schedulers.blocking import BlockingScheduler | |
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
| for starting a redis server | |
| redis-server /usr/local/etc/redis.conf | |
| for running terminal internal redis commands | |
| redis-cli | |
| set mykey myvalue | |
| get mykey |
NewerOlder