Skip to content

Instantly share code, notes, and snippets.

View hervehobbes's full-sized avatar

Hervé hervehobbes

View GitHub Profile
@hervehobbes
hervehobbes / php
Last active March 24, 2017 12:12
ERR_TOO_MANY_REDIRECTS
==========
routes.php
==========
use Cake\Core\Plugin;
use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;
use Cake\Routing\Route\DashedRoute;
Router::defaultRouteClass(DashedRoute::class);
@hervehobbes
hervehobbes / goto-sublime
Created May 24, 2016 11:05 — forked from kendellfab/goto-sublime
Add mouse click `goto definition` in sublime text 3.
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User
[
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
@hervehobbes
hervehobbes / ctrl-d.ahk
Created November 26, 2015 16:37
Simulate the Ctrl+D of SublimeText in all Windows programs with AutoHotKey (Ctrl+Shift+Win+D)
; Simule le Ctrl+D de SublimeText avec Ctrl+Shift+Win+D
+^#d::
{
SendInput ^{left}+^{right}
}
@hervehobbes
hervehobbes / uri.js
Created November 11, 2015 11:41 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@hervehobbes
hervehobbes / gist:b90b6b556a32341452f7
Created November 9, 2015 10:56
Sound Up and Sound Down with keyboard and AuoHotKey (if you don't have a multimedia keyboard)
; Ctrl+Windows+Alt+Plus (numeric pad) = Sound Up
^#!NumpadAdd::
{
Send {Volume_Up}
Return
}
; Ctrl+Windows+Alt+Minus (numeric pad) = Sound Down
^#!NumpadSub::
{
@hervehobbes
hervehobbes / ng-really.js
Created October 26, 2015 15:08 — forked from brunovianarezende/ng-really.js
ng-confirm - An AngularJS directive that creates a confirmation dialog for an action. Forked from https://gist.github.com/asafge/7430497
/**
* A generic confirmation for risky actions.
* Usage: Add attributes:
* * ng-confirm-message="Are you sure?"
* * ng-confirm-click="takeAction()" function
* * ng-confirm-condition="mustBeEvaluatedToTrueForTheConfirmBoxBeShown" expression
*/
angular.module('app').directive('ngConfirmClick', [function() {
return {
restrict: 'A',
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd">
<en-export export-date="20130730T205637Z" application="Evernote" version="Evernote Mac">
<note>
<title>Test Note for Export</title>
<content>
<![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Hello, World.
@hervehobbes
hervehobbes / ratchet_redis.php
Created September 28, 2015 16:58 — forked from jmoz/ratchet_redis.php
Ratchet and Predis-async. (React and Redis).
<?php
use RatchetApp\Pusher;
require __DIR__ . '/../vendor/autoload.php';
$loop = React\EventLoop\Factory::create();
$pusher = new Pusher();
$loop->addPeriodicTimer(10, array($pusher, 'timedCallback'));
@hervehobbes
hervehobbes / gist:550e908fe6f7668e26a7
Last active September 2, 2015 17:46 — forked from arlago/gist:632d5a977703c1bd3ba9
Use Vorlon.js to debug Ionic App.
-> Install Vorlon to start the server.
npm i -g vorlon
-> Add vorlon on Ionic App index page.
With sessionid if exists several apps in the same server
<script src="http://vorlon_server_host:1337/vorlon.js?SESSIONID"></script>
Uses default sessionid when one app per server.
<script src="http://vorlon_server_host:1337/vorlon.js"></script>
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git