Skip to content

Instantly share code, notes, and snippets.

View hervehobbes's full-sized avatar

Hervé hervehobbes

View GitHub Profile
@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 / 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 / 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 / increment_build_number.js
Created November 25, 2017 08:07
Cordova hook for incrementing build numbers
#!/usr/bin/env node
// Save hook under `project-root/hooks/before_prepare/`
//
// Don't forget to install xml2js using npm
// `$ npm install xml2js`
var fs = require('fs');
var xml2js = require('xml2js');
@hervehobbes
hervehobbes / settings.json
Last active December 11, 2017 15:38
Ma configuration de vscode
// Placez vos paramètres dans ce fichier pour remplacer les paramètres par défaut
{
"workbench.colorTheme": "Visual Studio Dark",
"editor.fontSize": 16,
"files.trimTrailingWhitespace": true,
"window.zoomLevel": 0,
"workbench.iconTheme": "material-icon-theme",
"workbench.editor.enablePreview": false,
"editor.minimap.enabled": false,
"terminal.external.windowsExec": "F:\\cmder\\cmder.exe",
@hervehobbes
hervehobbes / keybindings.json
Created December 6, 2017 10:22
Paramétrage de mes raccourcis clavier dans vscode
// Placez vos combinaisons de touches dans ce fichier pour remplacer les valeurs par défaut
[
{ "key": "ctrl+1", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus" },
{ "key": "ctrl+2", "command": "workbench.action.terminal.focus", "when": "!terminalFocus" }
]
@hervehobbes
hervehobbes / logo.svg
Created May 7, 2018 11:42 — forked from christopherkade/logo.svg
Star Wars SVG logo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hervehobbes
hervehobbes / form.ts
Created May 11, 2018 11:29 — forked from djabif/form.ts
Ionic Password validator
import { PasswordValidator } from '../../validators/password.validator';
this.matching_passwords_group = new FormGroup({
password: new FormControl('', Validators.compose([
Validators.minLength(5),
Validators.required,
Validators.pattern('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9]+$') //this is for the letters (both uppercase and lowercase) and numbers validation
])),
confirm_password: new FormControl('', Validators.required)
}, (formGroup: FormGroup) => {
return PasswordValidator.areEqual(formGroup);
@hervehobbes
hervehobbes / password.validator.ts
Created May 11, 2018 11:30 — forked from djabif/password.validator.ts
Password Validator for ionic apps
import { FormControl, FormGroup } from '@angular/forms';
export class PasswordValidator {
static areEqual(formGroup: FormGroup) {
let val;
let valid = true;
for (let key in formGroup.controls) {
if (formGroup.controls.hasOwnProperty(key)) {
let control: FormControl = <FormControl>formGroup.controls[key];
@hervehobbes
hervehobbes / phone.validator.ts
Created May 11, 2018 11:30 — forked from djabif/phone.validator.ts
Angular Phone + Country Validator
import { AbstractControl, ValidatorFn } from '@angular/forms';
import * as libphonenumber from 'google-libphonenumber';
export class PhoneValidator {
// Inspired on: https://github.com/yuyang041060120/ng2-validation/blob/master/src/equal-to/validator.ts
static validCountryPhone = (countryControl: AbstractControl): ValidatorFn => {
let subscribe = false;
return (phoneControl: AbstractControl): {[key: string]: boolean} => {