Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
from threading import Thread, Event | |
from queue import Queue, Empty | |
from kafka import KafkaConsumer, KafkaProducer | |
from kafka.structs import TopicPartition, OffsetAndMetadata | |
from kafka.consumer.fetcher import ConsumerRecord | |
from kafka.errors import CommitFailedError | |
class KafkaWorker(object): | |
def __init__(self, topics, hosts, poll_timeout=1): |
var AppConstants = require('../constants/AppConstants.js'); | |
var AppDispatcher = require('../dispatchers/AppDispatcher.js'); | |
var api = require('../utils/api'); | |
var ActionTypes = AppConstants.ActionTypes; | |
module.exports = { | |
create_customer: function(data){ | |
api.customer.create(data); | |
} |
# if not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# Detect platform | |
platform='unknown' | |
unamestr=`uname` | |
if [[ "$unamestr" == 'Linux' ]]; then | |
platform='linux' | |
elif [[ "$unamestr" == 'FreeBSD' ]]; then | |
platform='freebsd' |
/** | |
* react-helper.js | |
* | |
* Helper for Facebook's React UI Library. Add support for declare | |
* component on DOM (similar to AngularJS Directive). | |
* | |
* Usage: | |
* - Register a component: | |
* ReactHelper.register('MyComponent', MyComponent) | |
* - Declare the DOM node: |
<script type="text/ng-template" id="one.html"> | |
<div>This is first template</div> | |
</script> | |
<script type="text/ng-template" id="two.html"> | |
<div>This is second template</div> | |
</script> |
/* | |
use ver 2 | |
provide: | |
connection pool | |
auto reconnect | |
Usage: | |
MySql = require 'lib/mysql' This one | |
mysql = new MySql(Config) |
from flask import Flask, jsonify, Blueprint, current_app | |
import json | |
## REST api ################################################################### | |
api = Blueprint('api', __name__) | |
@api.route("/users") | |
def users(): | |
return jsonify(users=[ |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#!/bin/sh | |
~/Applications/UniversalIndentGUI/indenters/uncrustify -l OC -q -c ~/Applications/UniversalIndentGUI/config/uncrustify_obj_c.cfg |