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 collections import deque | |
class Edge(object): | |
def __init__(self, _id, data): | |
self.id = _id | |
self.data = data | |
def __str__(self): | |
return "Edge {}".format(self.id) |
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 redis | |
r = redis.Redis() | |
base = 0 # Smallest allowed key in samples | |
jump = 50 # Key size bins | |
top = 1300 # Largest allowed key in sample | |
samples = 1000 # Numbers of samples | |
bins = [] | |
for i in xrange(1+(top-base)/jump): |
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
<?php | |
/** | |
* Get the router adapters installed | |
*/ | |
public function getRouterAdapters() | |
{ | |
$adapters = []; | |
if (class_exists('Aura\Router\Router')) { | |
$adapters[] = [ 'Zend\Expressive\Router\Aura' ]; | |
} |
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
using System; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Web; | |
namespace ConsoleApplication1 | |
{ | |
class Program |
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
(function(window, document) { | |
// The end user should be allowed to disable synchronization. This button | |
// is optional on the page | |
var syncAllow = true; | |
var syncButton = document.querySelector('.sync-button'); | |
// If the sync button exists bind a click event and toggle the syncAllow | |
// boolean. Set the value of the button. | |
if(syncButton) { |
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
// geo-location shim | |
// currentely only serves lat/long | |
// depends on jQuery | |
;(function(geolocation){ | |
if (geolocation) return; | |
var 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
<?php | |
namespace Application\Rest; | |
use Zend\InputFilter\Input; | |
use Zend\InputFilter\InputFilter; | |
use Zend\Stdlib\Parameters; | |
use ZF\ApiProblem\ApiProblem; | |
use ZF\Rest\ResourceEvent; | |
abstract class AbstractResourceListener extends \ZF\Rest\AbstractResourceListener { |
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
<?php | |
class DetermineDSNForPDO{ | |
public $dsn = ''; | |
public $system_failover = FALSE; |
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
Show hidden characters
{ | |
"cmd": ["python", "-u", "$file"], | |
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", | |
"selector": "source.python", | |
"env":{ | |
"PYTHONPATH": "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages" | |
} | |
} |
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 re | |
''' | |
pip install flask | |
pip install coopy | |
''' | |
from coopy.base import init_persistent_system | |
from flask import Flask, request, redirect, jsonify |
OlderNewer