PATCH https://api.bukalapak.com/v2/products/:id/push.json
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, json, time, datetime, math, curses | |
#global variables | |
KANBAN_FILE = os.path.expanduser("~/.kanban.json") | |
DEFAULT_KANBAN = { | |
"tasks" : [], | |
"boards" : ["To do", "Doing", "Done"], | |
"work_time" : 25 * 60, | |
"rest_time" : 5 * 60 | |
} |
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
from django.conf import settings | |
from django.core.cache import cache | |
from django.contrib.auth.models import User | |
from django.utils.deprecation import MiddlewareMixin | |
ONLINE_THRESHOLD = getattr(settings, 'ONLINE_THRESHOLD', 60 * 15) | |
ONLINE_MAX = getattr(settings, 'ONLINE_MAX', 50) | |
def get_online_now(self): | |
return User.objects.filter(id__in=self.online_now_ids or []) |
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 twitter | |
import json | |
import pickle | |
import time | |
import random | |
import sys | |
import csv | |
import twitter__login | |
# log in, and collect statuses containing a keyword |
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
from collections import Counter | |
# get top ten entities | |
top_words = [item[0] for item in Counter(words).most_common()[:10]] | |
top_words_freq = [item[1] for item in Counter(words).most_common()[:10]] | |
top_screen_names = [item[0] for item in Counter(screen_names).most_common()[:10]] | |
top_screen_names_freq = [item[1] for item in Counter(screen_names).most_common()[:10]] | |
top_hashtags = [item[0] for item in Counter(hashtags).most_common()[:10]] | |
top_hashtags_freq = [item[1] for item in Counter(hashtags).most_common()[:10]] |
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
Pinky on the cartoon "Pinky and the Brain" had a British accent because the producers were big fans of Monty Python. | |
---- | |
Terry Gilliam laughs off Variety's dead Python blunder http://t.co/9axxZIjRPt | |
---- | |
RT CoinfeedIO "#Bitcoin How to Program blockchain Explorers with Python, Part 1 http://t.co/GHNNNGJ0QT" | |
---- | |
RT @HelenPaul_: PHOTOS: Man Kills Scary Gigantic Python Right Inside His House http://t.co/u6a3YidZbt | |
---- | |
Why call an application #bash ? It just encourages abuse against computers. On the plus side, script is working #webdev #python | |
#bash |
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 urllib, urllib2, json | |
def search_twitter(query, no_retweets=True): | |
if no_retweets: | |
# use the negation operator to filter out retweets | |
query += ' -RT' | |
url = 'http://search.twitter.com/search.json?%s' % urllib.urlencode({ | |
'q': query, | |
'lang': 'en', # restrict results to english tweets |
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 tweepy | |
import codecs | |
BRAZIL_WOEID = 23424768 | |
twapi = tweepy.API() | |
ret = twapi.trends_location(woeid=BRAZIL_WOEID) | |
fhandle = codecs.open("file.txt", "w", encoding="utf-8") | |
for trend in ret[0]['trends']: |
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 | |
# -*- encoding: utf-8 -*- | |
#from tweepy.streaming import StreamListener | |
#from tweepy import OAuthHandler | |
#from tweepy import Stream | |
import tweepy | |
import json | |
import codecs | |
import os |
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
@font-face { | |
font-family: "Proxima Nova"; | |
src: url(data:font/opentype;base64,d09GRgABAAAAAEywABIAAAAAg3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEWU5BAAAGbAAAALgAAAGJNI0oHkZGVE0AAAGUAAAAHAAAABxdnq2WR0RFRgAAByQAAAA4AAAAQgSqBTxHUE9TAAAHXAAABCIAABH0zI0AF09TLzIAAAXUAAAAVwAAAGCAz3p9Y21hcAAASvgAAAG2AAAC5lCJVL9jdnQgAAABsAAAAB4AAAAeCkcLCmZwZ20AAAHQAAABsgAAAmUjtC+nZ2FzcAAAA4QAAAAIAAAACAAAABBnbHlmAAALgAAAO4sAAF8I3FzIU2hlYWQAAAOMAAAANQAAADb9TDtqaGhlYQAABiwAAAAgAAAAJA9PBsBobXR4AABHDAAAAh8AAANsqw8hfGxvY2EAAEksAAABuAAAAbhtqYQ8bWF4cAAABkwAAAAgAAAAIAIDAhpuYW1lAAADxAAAAawAAANRLIw+gnBvc3QAAErkAAAAEwAAACD/DQAocHJlcAAABXAAAABjAAAAdNUcAaMAAAABAAAAAMmJbzEAAAAAyRrF1wAAAADK+niN/pAAAAPGBTYBYADCANABNgE+AWgBmQDkAZIBkAFYAAB42l1Ru05bQRDdDQ+TBBJjg+RoU8xmQhrvhYYCJBBXF8XIdmM5QtqNXORiXMAHUCBRg/ZrBmgoKdKmQcgFUj6BT0BiZk2iKM3Ozuycc+bMknKk6l1a73nqnARSuNOg2abfDql2FuCedH21kZF28EDzzYxeuW7ff8VgM5pyRw2gvOct5SGjaSdQi/bU/za/guE+/2Qeg0FLM01PrZOQHkJgvhm3MPie0ay7/KQvWB0uBgNDimkq7vJzKuV/S3Outgibaxm9dnAmIj+ZBmhqpY1A0186pHo+jmIJctkw1gYTU9afZCL4ZjJd1VQtM751cJfszDt |