Skip to content

Instantly share code, notes, and snippets.

Avatar
📱
Working

Quentin Dreyer qkdreyer

📱
Working
View GitHub Profile
@qkdreyer
qkdreyer / mongodb.sh
Last active Apr 21, 2016
Debian MongoDB
View mongodb.sh
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/debian "$(lsb_release -sc)"/mongodb-org/3.0 main" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list
apt-get update
apt-get install -y mongodb-org
use "admin";
db.createUser({user: 'root', pwd: 'root', roles: ['root']});
use "test";
db.createUser({user: 'admin', pwd: 'admin', roles: ['dbOwner']});
View pubkey.gpg
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFcc3/YBEAC9HUBLsLQR9RJa0qsmdnyf4jWWoES6ISKneZZQB0uhFBwo7r+i
CvGfWgPsILSnkC+hpvIo01Holq/PgOrNEowQ1MtUWE8O29fO+Ez4X2FPlL16FGiM
IF3+BoV615HWOruDf5faI5enBQ0Cgq5tKSz/KomWeHxjwSd8MB7uQ23IvX8xMESv
TiQ4K8ulQy3zgGqzjKMLY7JS1jinI3em9LYCVZ/QkD2OKJ38id4wf+4jM/YqEjg2
eJfvMkJXaAVZ04Exp4VhzZ8+iLTZWHHowNpv2d9MS75aMm3NMZ4BffN2iTSGZ/pw
SX2QtLIL+j9Mr2/eaxYan9NQusfZ9XiWK9gwdTtO+0zAtk05E7SzMIy08M3Kuvnn
9Pz0WDqol486eAV/rLe4d6wpsbw+GChl13DNe69JzBYnSI42zPAagFFN7dQBac9S
@qkdreyer
qkdreyer / .gitconfig
Last active Jun 3, 2016
OSX Git Configuration
View .gitconfig
[core]
excludesfile = ~/.gitignore_global
editor = subl
autocrlf = input
[user]
email = quentin.dreyer@gmail.com
name = qkdreyer
signingkey = AE749F81
[push]
default = current
@qkdreyer
qkdreyer / php.re
Last active Sep 19, 2016
PHP Code Checker Regex
View php.re
PHP Code Checker
(?:(?!//).)*?\K(dump|die)[;\(]
HTML Whole Word Classname
class="[^"]+[\s|"](?=shop[\s|"])
@qkdreyer
qkdreyer / ios-webinspector
Last active Dec 15, 2016
Automatically open Safari Web Inspector
View ios-webinspector
#!/usr/bin/osascript
# Automatically open Safari Web Inspector
set _browser to "Safari"
set _develop to "Développement"
set _inspector to "Inspecteur web"
set _phone to "iPhone"
set _ignore to "about:"
tell application _browser to activate
@qkdreyer
qkdreyer / .phpmd.xml
Last active Jan 8, 2017
PHP Coding Ruleset
View .phpmd.xml
<?xml version="1.0"?>
<ruleset name="PHP Coding Ruleset" xmlns="https://github.com/qkdreyer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<rule ref="rulesets/cleancode.xml">
<exclude name="ElseExpression"/>
</rule>
<rule ref="rulesets/codesize.xml">
<exclude name="CyclomaticComplexity"/>
<exclude name="ExcessiveParameterList"/>
</rule>
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
@qkdreyer
qkdreyer / useful-regexp.md
Last active Aug 8, 2017
Useful Regular Expressions
View useful-regexp.md

Username /^[a-z0-9_-]{3,16}$/

Password /^[a-z0-9_-]{6,18}$/

Hex Value /^#?([a-f0-9]{6}|[a-f0-9]{3})$/

Slug

View keybase.md

Keybase proof

I hereby claim:

  • I am qkdreyer on github.
  • I am qkdreyer (https://keybase.io/qkdreyer) on keybase.
  • I have a public key ASAB85aNeoCds9DgXm0Sg_fhSRUViA9ZSZ6QdmMYv0rZ9go

To claim this, I am signing this object:

View gist:7aa37e0256694919d735732f00f53904
CREATE DATABASE `db`;
GRANT ALL PRIVILEGES ON `db`.* TO `user`@`localhost` IDENTIFIED BY `password` WITH GRANT OPTION; FLUSH PRIVILEGES;
@qkdreyer
qkdreyer / crypto-loot.js
Last active Nov 26, 2017
Crypto Loot Script
View crypto-loot.js
(function(doc, tag, cb) {
var js = doc.createElement(tag), ref = doc.getElementsByTagName(tag)[0];
js.async = true;
js.onload = js.onreadystatechange = function(_, isAbort) {
if (isAbort || !js.readyState || /loaded|complete/.test(js.readyState)) {
js.onload = js.onreadystatechange = null;
js = undefined;
!isAbort && cb && cb();
}
};