(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
function encrypt(text){ | |
var cipher = crypto.createCipher('aes-256-cbc','d6F3Efeq') | |
var crypted = cipher.update(text,'utf8','hex') | |
crypted += cipher.final('hex'); | |
return crypted; | |
} | |
function decrypt(text){ | |
var decipher = crypto.createDecipher('aes-256-cbc','d6F3Efeq') | |
var dec = decipher.update(text,'hex','utf8') |
# gcc -Wall -o match match.c && ./match | |
# | |
#include <stdio.h> | |
#include <string.h> | |
#include <regex.h> | |
AF,Africa,6255146 | |
AS,Asia,6255147 | |
EU,Europe,6255148 | |
NA,North America,6255149 | |
OC,Oceania,6255151 | |
SA,South America,6255150 | |
AN,Antarctica,6255152 |
/* | |
* Simple JavaScript game manager. | |
* | |
* (c) 2012 Guido Krömer <mail@cacodaemon.de> | |
* | |
*/ | |
function GameManager () { | |
var canvas = null; | |
var ctx = null; | |
var delta = 0; |
# A worked example based on http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/urldispatch.html#using-pyramid-security-with-url-dispatch | |
# in your configuration section (typically in myapp/__init__.py) | |
config.add_route('articles.edit', 'article/{id}/edit', factory='myapp.acl.ArticleACL') | |
# in myapp/acl.py | |
class ArticleACL(object): | |
def __init__(self, request): | |
# First, we assume this ACL object is used only in routes that provide an article id; if need be, you can add some sanity checking here, or some if/else branching |
#!/usr/bin/env python | |
__author__ = 'Kevin Warrick' | |
__email__ = 'kwarrick@uga.edu' | |
import cPickle | |
from functools import wraps | |
def redis_lru(capacity=5000, slice=slice(None)): | |
""" | |
Simple Redis-based LRU cache decorator *. |
var spawn = require("child_process").spawn; | |
var Q = require("q"); | |
/** | |
* Wrap executing a command in a promise | |
* @param {string} command command to execute | |
* @param {Array<string>} args Arguments to the command. | |
* @param {string} cwd The working directory to run the command in. | |
* @return {Promise} A promise for the completion of the command. | |
*/ |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# http block | |
geoip_city /usr/local/share/GeoIP/GeoIPCity.dat; | |
geoip_country /usr/local/share/GeoIP/GeoIPCountry.dat; | |
# location block | |
proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code; | |
proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3; | |
proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name; |
Steps to connect device with Android Studio in Ubuntu:- | |
1. Enable USB debugging on your device. | |
2. Go to root and create a file: sudo vi /etc/udev/rules.d/51-android.rules | |
a. Add the following text in the file: | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev" | |
** Note: vendor id is different for each company. | |
Company USB Vendor ID | |
Acer 0502 | |
ASUS 0b05 | |
Dell 413c |