Skip to content

Instantly share code, notes, and snippets.

View lukasklein's full-sized avatar
👀
Facebook is it you?

Lukas Klein lukasklein

👀
Facebook is it you?
View GitHub Profile
from django.forms.widgets import Input
class NumberInput(Input):
input_type = 'number'
from datetime import datetime
LINES = [
'ITLISBFAMPM',
'ACQUARTERDC',
'TWENTYFIVE<X',
'HALFBTEN<FTO',
'PASTERUNINE',
'ONESIXTHREE',
'FOURFIVE>TWO',
{
"page": 1,
"limit": 50,
"explicit": false,
"total": 16,
"has_more": false,
"list": [{
"id": "music",
"name": "Music",
"description": "Watch music videos, concerts, and interviews from artists in every genre, from hip-hop and rock to indie and electro. Live performances, news and exclusives."
@lukasklein
lukasklein / output
Created April 23, 2015 16:53
PHP can't handle Moscow Time
+02:00 # Correct
+04:00 # Wrong, it has been set to UTC+3 permanently on 26 October 2014: http://sputniknews.com/russia/20141026/194606015.html
#!/usr/bin/env python
"""
Facebook-Event-Stalking-Tool
"""
import urllib2, json, re
from types import NoneType
access_token = "your facebook access token"
//
// CameraAvailable.h
//
//
// Created by Lukas Klein on 08-19-11.
// MIT Licensed
// Copyright (c) Lukas Klein
#import <foundation foundation.h="">
#ifdef PHONEGAP_FRAMEWORK
import random, os, urllib, urllib2, time, getpass
from urlparse import urlparse
rootpass = getpass.getpass()
interface = "en0"
testurl = "http://www.google.com/robots.txt"
stringtotest = "User-agent: *"
def randomMAC():
mac = [ 0x00, 0x16, 0x3e,
import DNS, smtplib, socket
def checkmail(mail):
DNS.DiscoverNameServers()
print "checking %s..."%(mail)
hostname = mail[mail.find('@')+1:]
mx_hosts = DNS.mxlookup(hostname)
failed_mx = True
for mx in mx_hosts:
smtp = smtplib.SMTP()
from django.conf import settings
def get_client_ip(request):
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
ip = x_forwarded_for.split(',')[0]
else:
ip = request.META.get('REMOTE_ADDR')
return ip
docker:
image: jpetazzo/dind
privileged: true
environment:
- PORT=4444
transcoder:
build: transcoder
restart: always
command: /usr/local/bin/gunicorn -w 2 -b :8000 app:app
links: