Skip to content

Instantly share code, notes, and snippets.

View level09's full-sized avatar
🌴
Always on vacation

Nidal Alhariri level09

🌴
Always on vacation
View GitHub Profile
@level09
level09 / gist:b2970326a33d88c27ef24bf6bb803bc1
Created October 1, 2018 18:14 — forked from Sinkler/gist:bfc2099235ac96937f34
Flask-OAuthlib sample config: twitter, facebook, instagram, vk
# Twitter
from app.config import TWITTER_APP_KEY, TWITTER_APP_SECRET
twitter_oauth = oauth.remote_app(
'twitter',
consumer_key=TWITTER_APP_KEY,
consumer_secret=TWITTER_APP_SECRET,
base_url='https://api.twitter.com/1.1/',
request_token_url='https://api.twitter.com/oauth/request_token',
@level09
level09 / 0_reuse_code.js
Created March 12, 2016 11:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
"""
This is a simple example of WebSocket + Tornado + Redis Pub/Sub usage.
Do not forget to replace YOURSERVER by the correct value.
Keep in mind that you need the *very latest* version of your web browser.
You also need to add Jacob Kristhammar's websocket implementation to Tornado:
Grab it here:
http://gist.github.com/526746
Or clone my fork of Tornado with websocket included:
http://github.com/pelletier/tornado
Oh and the Pub/Sub protocol is only available in Redis 2.0.0:

Django-celery + Redis notes

Installation and Setup

  1. Install redis on OSX (10.7) Lion I used:

     $ brew install redis
    
  2. In the project and virtualenv I wanted to use django-celery in I installed the following.

@level09
level09 / redis.markdown
Created January 18, 2012 16:36 — forked from bdotdub/redis.markdown
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

@level09
level09 / gist:1510613
Created December 22, 2011 15:06 — forked from anarchivist/gist:263281
Accessing Drupal's XMLRPC/Services API from Python
# probably ripped off from somewhere on drupal.org
# requires the services module
import xmlrpclib
s = xmlrpclib.ServerProxy('http://localhost/services/xmlrpc')
class DrupalNode:
def __init__(self, title, body, path, ntype='page', uid=1, username='mmatienzo'):
self.title = title