Skip to content

Instantly share code, notes, and snippets.

Marlinc Marlinc

  • Eindhoven, The Netherlands
Block or report user

Report or block Marlinc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
set -eu
_UID=$(id -u)
GID=$(id -g)
# give lxd permission to map your user/group id through
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root
# set up a separate key to make sure we can log in automatically via ssh
# with $HOME mounted
ianbarber / gist:5170508
Last active Jul 25, 2019
Example Sign In activity for Google Sign-In on Android that retrieves an authorization code for use with server side authentication. See for more background and links.
View gist:5170508
package com.example.anothersignintest;
hnaohiro / go-urlencode
Created Jan 24, 2013
Golang URL Encode
View go-urlencode
func urlencode(s string) (result string){
for _, c := range(s) {
if c <= 0x7f { // single byte
result += fmt.Sprintf("%%%X", c)
} else if c > 0x1fffff {// quaternary byte
result += fmt.Sprintf("%%%X%%%X%%%X%%%X",
0xf0 + ((c & 0x1c0000) >> 18),
0x80 + ((c & 0x3f000) >> 12),
0x80 + ((c & 0xfc0) >> 6),
0x80 + (c & 0x3f),
schoentoon /
Created Jan 13, 2013
Simple documentation for the Mac2Vendor broadcast Interface
package com.example.mac2vendortest;
import android.os.Bundle;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.widget.TextView;
oodavid /
Last active Dec 24, 2019 — forked from aronwoost/
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
    • apache's home directory is /var/www/
Thinkscape /
Created Sep 22, 2011
PSR-0 Final Proposal (PHP Standards Working Group)

PSR-0 Final Proposal (PHP Standards Working Group)

The following describes the mandatory requirements that must be adhered to for autoloader interoperability.


  • A fully-qualified namespace and class must have the following structure \ <Vendor Name> \ (<Namespace>)* \ <Class Name>
  • Each namespace must have a top-level namespace ("Vendor Name").
  • Each namespace can have as many sub-namespaces as it wishes.
  • Each namespace separator is converted to a DIRECTORY_SEPARATOR when loading from the file system.
  • Each "_" character in the CLASS NAME is converted to a DIRECTORY_SEPARATOR. The "_" character has no special meaning in the namespace.
dzuelke / bcrypt.php
Last active Oct 11, 2019
How to use bcrypt in PHP to safely store passwords (PHP 5.3+ only)
View bcrypt.php
// secure hashing of passwords using bcrypt, needs PHP 5.3+
// see
// salt for bcrypt needs to be 22 base64 characters (but just [./0-9A-Za-z]), see
$salt = substr(strtr(base64_encode(openssl_random_pseudo_bytes(22)), '+', '.'), 0, 22);
// 2y is the bcrypt algorithm selector, see
// 12 is the workload factor (around 300ms on my Core i7 machine), see
You can’t perform that action at this time.