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
#!/usr/bin/env python3 | |
# Author: Supreet Sethi <[email protected]> | |
# License: Creative Commons BY-SA 2.0 | |
from string import ascii_lowercase | |
WORDSFILE = '/usr/share/dict/words' # this is specific to mac os | |
def alphabet_prime_data(): |
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
https://www.smartkarma.com/segment/feeds/issfocus.rss | |
https://www.smartkarma.com/segment/feeds/reports.rss | |
https://www.smartkarma.com/segment/feeds/cons.rss | |
https://www.smartkarma.com/segment/feeds/growth.rss | |
https://www.smartkarma.com/segment/feeds/multi_strategy.rss | |
https://www.smartkarma.com/segment/feeds/[email protected] | |
https://www.smartkarma.com/segment/feeds/china.rss | |
https://www.smartkarma.com/segment/feeds/equity_bottom_up.rss | |
https://www.smartkarma.com/segment/feeds/thematic_&_strategy.rss | |
https://www.smartkarma.com/segment/feeds/tmt.rss |
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 unittest | |
def flatten(l): | |
collect = [] | |
# make user l is iterable of some sort and not a dictionary | |
if hasattr(l, '__iter__') and not isinstance(l, dict): | |
for e in l: | |
print e | |
print flatten(e) | |
collect += flatten(e) |
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
#!/usr/bin/env python | |
#pip install requests | |
#pip install bs4 | |
#Author: Supreet Sethi <[email protected]> | |
#Date: Fri Jul 15 14:11:38 WIB 2016 | |
#License: MIT | |
from requests import get | |
import cookielib | |
from bs4 import BeautifulSoup |
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 Shopify.Oauth do | |
@moduledoc """ | |
An OAuth2 strategy for Shopify. | |
Based on the OAuth2 strategy for GitHub by Sonny Scroggin | |
in https://github.com/scrogson/oauth2_example | |
""" | |
use OAuth2.Strategy | |
alias OAuth2.Strategy.AuthCode | |
alias OAuth2.Request |
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
rom collections import namedtuple | |
product = namedtuple("Product", [ | |
'catalog_id', | |
'price', | |
'basic_discount', | |
'user_specific_discount', | |
'category']) |
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 main | |
import ( | |
"os" | |
"encoding/xml" | |
"strings" | |
"log" | |
"runtime/debug" | |
) |
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 main | |
import ( | |
"log" | |
"strings" | |
) | |
func isVowel(chr_ rune) bool { | |
chr := string(chr_) | |
if (strings.EqualFold(chr, "a") || strings.EqualFold(chr, "e") || |
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 logging | |
from urllib2 import urlopen, Request | |
import re | |
from bs4 import BeautifulSoup as Soup | |
from optparse import OptionParser | |
from collections import namedtuple, Mapping | |
import sys | |
__author__ = "Supreet Sethi <[email protected]>" | |
__copyright__ = "Copyright (C) 2014 Supreet Sethi" |
NewerOlder