Skip to content

Instantly share code, notes, and snippets.

Avatar

Rouven Weßling realityking

View GitHub Profile
@realityking
realityking / node-sass-stats.js
Last active Oct 24, 2019
node-sass download stats
View node-sass-stats.js
'use strict';
const json = require('./stats.json');
const table = require('markdown-table');
function getHumanNodeVersion(abi) {
switch (parseInt(abi, 10)) {
case 11: return 'Node 0.10.x';
case 14: return 'Node 0.12.x';
case 42: return 'io.js 1.x';
@realityking
realityking / webhook.js
Created Sep 6, 2017
Simple webhook receiver
View webhook.js
'use strict';
const hapi = require('hapi');
const server = new hapi.Server();
// Tell our server that it will listen on port 3001
server.connection({ port: 3001 });
// Setup the route for our webhook
@realityking
realityking / index.js
Created Sep 4, 2017
Count slack messages by bot in a channel
View index.js
'use strict';
const WebClient = require('@slack/client').WebClient;
const TOKEN = process.env.SLACK_TOKEN;
const CHANNEL_NAME = 'cofftentful';
const BOT_ID = 'B4XNQQK3M';
const web = new WebClient(TOKEN);
@realityking
realityking / magic.js
Created Jul 7, 2017
Lyn posing weird questions
View magic.js
'use strict';
var table1 = [
[{content: 'r0c0'}, {content: 'r0c1'}, {content: 'r0c2', colSpan: 2, rowSpan: 3}, {content: 'r0c4'}],
[{content: 'r1c0', colSpan: 2, rowSpan: 2}, {content: 'r1c4'}],
[{content: 'r2c4'}],
[{content: 'r3c0'}, {content: 'r3c1'}, {content: 'r3c2'}, {content: 'r3c3'}, {content: 'r3c4'}]
];
var table2 = [
@realityking
realityking / .clang-format
Created Feb 4, 2016
Clang Format for PHP config
View .clang-format
---
Language: Cpp
IndentWidth: 4
TabWidth: 4
UseTab: ForIndentation
AlignConsecutiveAssignments: true
BreakBeforeBraces: Linux
ColumnLimit: 0
MacroBlockBegin: '^ZEND_BEGIN_ARG_INFO'
MacroBlockEnd: '^ZEND_END_ARG_INFO'
@realityking
realityking / definitions.php
Created Dec 16, 2015
PHP Unified Symbol Table Example
View definitions.php
<?php
class TestClass
{
public $prop = 'hello';
}
function test_function($a)
{
return $a;
View gist:ef11511ad8d266bf13a7
<html>
<head>
<style>
.something {
font: 700 300px sans-serif;
position: absolute;
}
</style>
<script>
function animate(element, color) {
View gist:10214636
* thread #1: tid = 0x7ed76, 0x0000000100331817 php`zend_std_object_get_class_name(object=0x00000001058795f0, class_name=0x00007fff5fbfdc48, class_name_len=0x00007fff5fbfdc44, parent=0) + 167 at zend_object_handlers.c:1542, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
frame #0: 0x0000000100331817 php`zend_std_object_get_class_name(object=0x00000001058795f0, class_name=0x00007fff5fbfdc48, class_name_len=0x00007fff5fbfdc44, parent=0) + 167 at zend_object_handlers.c:1542
frame #1: 0x00000001002ee20f php`zend_get_object_classname(object=0x00000001058795f0, class_name=0x00007fff5fbfdc48, class_name_len=0x00007fff5fbfdc44) + 79 at zend_API.c:250
frame #2: 0x0000000100309fa3 php`zif_get_class(ht=1, return_value=0x000000010598e7d0, return_value_ptr=0x000000010068ff20, this_ptr=0x0000000000000000, return_value_used=1) + 355 at zend_builtin_functions.c:771
frame #3: 0x000000010038edba php`zend_do_fcall_common_helper_SPEC(execute_data=0x0000000100690038) + 1370 at ze
View Travis Output
Using worker: worker-linux-6-1.bb.travis-ci.org:travis-linux-4
travis_fold:start:git.1
$ git clone --depth=50 --branch=phpunit-broken git://github.com/realityking/swiftmailer.git realityking/swiftmailer
Cloning into 'realityking/swiftmailer'...
remote: Counting objects: 3010, done.
remote: Compressing objects: 0% (1/2027) 
remote: Compressing objects: 1% (21/2027) 
remote: Compressing objects: 2% (41/2027) 
remote: Compressing objects: 3% (61/2027) 
View bench.php
#!/usr/bin/env php
<?php
/**
* JSON/BSON encoding and decoding benchmark
*
* Now with native serializing!
*
* @copyright 2013 Trevor N Suarez
* @link http://blennd.com/
* @author Trevor Suarez <rican7@gmail.com>