Skip to content

Instantly share code, notes, and snippets.

View schmkr's full-sized avatar

Alwin Schoemaker schmkr

View GitHub Profile
// Highcharts CheatSheet Part 1.
// Create interactive charts easily for your web projects.
// Download: http://www.highcharts.com/download
// More: http://api.highcharts.com/highcharts
// 1. Installation.
// Highcharts requires two files to run, highcharts.js and either jQuery, MooTools or Prototype or the Highcharts Standalone Framework which are used for some common JavaScript tasks.
// <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
// <script src="http://code.highcharts.com/highcharts.js"></script>
# NPM CheatSheet.
# Super easy intall: npm comes with node now.
# To create your own npm package: https://www.npmjs.org/doc/misc/npm-developers.html
# More: https://www.npmjs.org/doc/
# 1. NPM Command Lines.
# Local mode is the default.
# Use --global or -g on any command to operate in global mode instead.
@schmkr
schmkr / gist:505f69bb4e4cd96a56c4
Created August 14, 2014 15:06
Onename.io verification
Verifying that +schmkr is my Bitcoin username. You can send me #bitcoin here: https://onename.io/schmkr
@schmkr
schmkr / crontab.txt
Created August 25, 2014 15:05
An example of how to get the output of a cronjob to go to both STDOUT (so it can be emailed to MAILTO) and logged to a file.
0 0 * * * sh script.sh 2>&1 | tee -a /var/log/script.`date +\%Y\%m\%d`.log
@schmkr
schmkr / PasswordRandomValue.js
Created November 5, 2015 12:08
Paw extension for generating random passwords.
(function() {
var PasswordRandomizerDynamicValue,
charset = [
"abcdefghijklmnopqrstuvwxyz",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"0123456789",
"!@#$%ˆ&*()-=_+{}[]|<>,.?/"
].join('');
PasswordRandomizerDynamicValue = function() {
@schmkr
schmkr / bash-history-top10.sh
Created January 14, 2013 09:31
List your bash history top 10
cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 10
@schmkr
schmkr / smtp_catcher.php
Last active December 11, 2015 17:28
Script to catch mails on development machines
#!/usr/bin/env php
<?php
# create a filename for this email
list($ms, $time) = explode(' ', microtime());
$filename = '/tmp/'.date('Y-m-d h.i.s,', $time).substr($ms,2,3).'.txt';
# write the email contents to the file
$email_contents = fopen('php://stdin', 'r');
$fstat = fstat($email_contents);
@schmkr
schmkr / Readme.md
Last active December 22, 2015 17:39
Example of Composer Satis with a deep SVN structure

Example of output when running:

bin/satis build satis.json ./web -vvv

Current output

Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Scanning packages
@schmkr
schmkr / PrivateMethodCallerTrait
Created October 2, 2013 19:21
Get access to private methods (and properties), usefull for testing.
<?php
trait PrivateMethodCallerTrait {
protected function callPrivateMethod($object, $methodName, $args = array()) {
$fn = function($methodName, $args) {
return call_user_func_array(array($this, $methodName), $args);
};
$privateAccessor = $fn->bindTo($object,$object);
@schmkr
schmkr / keybase.md
Last active February 5, 2016 10:28

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: