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 csv | |
import os | |
import cProfile | |
import time | |
import numpy | |
import pandas | |
import warnings | |
# Make sure those files in the same folder as benchmark_python.py | |
# As the name indicates: |
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 smtplib | |
server = smtplib.SMTP('smtp.gmail.com', 587) | |
server.starttls() | |
server.login("YOUR EMAIL ADDRESS", "YOUR PASSWORD") | |
msg = "YOUR MESSAGE!" | |
server.sendmail("YOUR EMAIL ADDRESS", "THE EMAIL ADDRESS TO SEND TO", msg) | |
server.quit() |
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
def login(request, *args, **kwargs): | |
if request.method == 'POST': | |
if not request.POST.get('remember_me', None): | |
request.session.set_expiry(0) | |
return auth_views.login(request, *args, **kwargs) |
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
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( |
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 | |
class Game(object): | |
def __init__(self): | |
self.rolls = [0] * 21 | |
self.currentRoll = 0 | |
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
$ curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` > ./docker-compose | |
$ sudo mv ./docker-compose /usr/bin/docker-compose | |
$ sudo chmod +x /usr/bin/docker-compose |
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
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz | |
tar xvJf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz | |
sudo cp wkhtmltox/bin/wkhtmlto* /usr/bin/ |
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
# csv format: content | link_to_website | |
import requests | |
import csv | |
import json | |
import time | |
PAGE_ID = 'your_facebook_page_id' # find page id : https://findmyfbid.com | |
ACCESS_TOKEN = 'your_app_access_token' # https://developers.facebook.com/tools/explorer | |
REQUEST_FORM = 'https://graph.facebook.com/PAGE_ID/feed?message=TITLE&link=PRODUCT_LINK' |
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
# -*- coding: utf-8 -*- | |
from django.contrib.auth.decorators import login_required | |
from django.utils.cache import patch_response_headers | |
from django.utils.decorators import method_decorator | |
from django.views.decorators.cache import cache_page, never_cache | |
from django.views.decorators.csrf import csrf_exempt | |
class NeverCacheMixin(object): | |
@method_decorator(never_cache) |
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
#FROM http://mikelynchgames.com/software-development/installing-oracle-instant-client-and-sqlplus-on-osx/ | |
#REQUIRED | |
# instantclient-basic-macosx-<version>.zip | |
# instantclient-sdk-macosx-<version>.zip | |
# instantclient-sqlplus-macosx-<version>.zip | |
# put this script in the same folder as these downloaded |
OlderNewer