Skip to content

Instantly share code, notes, and snippets.

View Eboubaker's full-sized avatar
🐐

Eboubaker Bekkouche Eboubaker

🐐
  • Soft-lines LLC
  • Eloued, Algeria
  • 14:14 (UTC +01:00)
View GitHub Profile
@tomotaka
tomotaka / json_matcher.rb
Created August 14, 2012 16:00
recursive regexp pattern for JSON
# 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
@alexpeattie
alexpeattie / disable-autolinking.md
Created February 7, 2013 07:32
Disable Github-flavored Markdown autolinking

http://example.com

http://example.com

@roachhd
roachhd / README.md
Last active July 18, 2024 07:24
Basics of BrainFuck

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION

@Thinkscape
Thinkscape / EffectiveUrlMiddleware.php
Last active October 4, 2022 18:30
getEffectiveUrl() replacement for Guzzle 6.*
<?php
namespace Thinkscape\Guzzle;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
class EffectiveUrlMiddleware
{
/**
* @var Callable
@gesquive
gesquive / get_keypress.py
Last active October 29, 2022 09:02
Get keypress for different platforms
#!/usr/bin/env python3
# get_keypress.py
import sys
import os
def main():
try:
print("press ctrl+c to exit")
@ewwink
ewwink / http_response_code.php
Created February 14, 2016 02:30
PHP Class for HTTP Response Status Codes
<?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
*
@Cr4sh
Cr4sh / fork.c
Created March 19, 2016 15:08
fork() for Windows
/*
* 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);
}

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone git@gist.github.com:<hash>.git     # or with ssh