Skip to content

Instantly share code, notes, and snippets.

View hervehobbes's full-sized avatar

Hervé hervehobbes

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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