http://example.com
http://example.com
| # coding: utf-8 | |
| # only works on 1.9+ | |
| # base idea is from: | |
| # - http://stackoverflow.com/questions/2583472/regex-to-validate-json | |
| # - http://www.slideshare.net/takesako/shibuyapm16-regexpjsonvalidator | |
| module JsonMatcher | |
| NUMBER = /-? (?= [1-9]|0(?!\d) ) \d+ (\.\d+)? ([eE] [+-]? \d+)?/x | |
| BOOLEAN = /true | false | null/x |
http://example.com
http://example.com
| <?php | |
| namespace Thinkscape\Guzzle; | |
| use Psr\Http\Message\RequestInterface; | |
| use Psr\Http\Message\ResponseInterface; | |
| class EffectiveUrlMiddleware | |
| { | |
| /** | |
| * @var Callable |
| #!/usr/bin/env python3 | |
| # get_keypress.py | |
| import sys | |
| import os | |
| def main(): | |
| try: | |
| print("press ctrl+c to exit") |
| <?php | |
| /** | |
| * StatusCodes provides named constants for | |
| * HTTP protocol status codes. Written for the | |
| * Recess Framework (http://www.recessframework.com/) | |
| * | |
| * @author Kris Jordan | |
| * @license MIT | |
| * @package recess.http | |
| * |
| /* | |
| * fork.c | |
| * Experimental fork() on Windows. Requires NT 6 subsystem or | |
| * newer. | |
| * | |
| * Copyright (c) 2012 William Pitcock <nenolod@dereferenced.org> | |
| * | |
| * Permission to use, copy, modify, and/or distribute this software for any | |
| * purpose with or without fee is hereby granted, provided that the above | |
| * copyright notice and this permission notice appear in all copies. |
| Below are the Big O performance of common functions of different Java Collections. | |
| List | Add | Remove | Get | Contains | Next | Data Structure | |
| ---------------------|------|--------|------|----------|------|--------------- | |
| ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array | |
| LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List | |
| CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array | |
| namespace App\Http\Middleware; | |
| use Illuminate\Support\Facades\Log; | |
| class LogAfterRequest { | |
| public function handle($request, \Closure $next) | |
| { | |
| return $next($request); | |
| } |
# make sure to replace `<hash>` with your gist's hash
git clone https://gist.github.com/<hash>.git # with https
git clone [email protected]:<hash>.git # or with ssh