Skip to content

Instantly share code, notes, and snippets.

View rubensayshi's full-sized avatar

Ruben de Vries rubensayshi

  • Amsterdam, Netherlands
View GitHub Profile
var simpleWYSIHTML5 = {
"font-styles" : false, // Font styling, e.g. h1, h2, etc.
"emphasis" : true, // Italics, bold, etc.
"lists" : false, // (Un)ordered lists, e.g. Bullets, Numbers.
"html" : false, // Button which allows you to edit the generated HTML.
"link" : true, // Button to insert a link.
"image" : false, // Button to insert an image.
"color" : false, // Button to change color of font
"stylesheets" : []
};
server {
listen 8080;
server_name gw2spidy.rubensayshi.com gw2spidy.com;
rewrite ^(.*) http://www.gw2spidy.com$1 permanent;
}
server {
listen 8080;
server_name www.gw2spidy.com;
January 1 of YR10 An unknown province from RECRUITING 1 UD (8:10) captured 112 acres of land from Journey (2:32).
January 1 of YR10 C L O U D 0 9 (8:10) invaded and stole from Journey (2:32).
January 1 of YR10 An unknown province from RECRUITING 1 UD (8:10) captured 197 acres of land from Attila the Bunny (2:32).
January 1 of YR10 S E P H I R O T H (8:10) captured 164 acres of land from Attila the Bunny (2:32).
January 1 of YR10 Yomi (8:10) captured 78 acres of land from Attila the Bunny (2:32).
January 1 of YR10 An unknown province from RECRUITING 1 UD (8:10) captured 214 acres of land from Nasulic (2:32).
January 1 of YR10 Ziggie and the BlackHearts (2:32) attacked and stole from XxCyCLonEx (8:10).
January 2 of YR10 The Dutchies (8:10) captured 231 acres of land from Nasulic (2:32).
January 2 of YR10 RedDread (8:10) captured 359 acres of land from Little Feat (2:32).
January 2 of YR10 Kinich Ahau (2:32) invaded S E P H I R O T H (8:10) and killed 1,684 people.
@rubensayshi
rubensayshi / 00.dev_stringlike.py
Last active December 14, 2015 04:29
I want to be able to completely mimic a builtin str() with a class
import sys
from time import time
# limit recursion to avoid spam during debugging
sys.setrecursionlimit(50)
# ----------------------
# I want to be able to completely mimic a builtin str() with a class
# ----------------------
# ----------------------
@rubensayshi
rubensayshi / test.sql
Last active December 14, 2015 16:28
I'm trying to optimize my indexes for doing a JOIN and then GROUP BY one of the columns from the joined table. I'm testing by running the script below, playing with the indexes, but I just can't seem to figure out what indexes I need for the 3rd query. I think the code speaks for itself ;-) ... I just don't know the right index ...
CREATE DATABASE stats_idx_test;
USE stats_idx_test;
DROP TABLE stats;
CREATE TABLE stats (article_id INT, cnt INT, type INT);
ALTER TABLE stats ADD INDEX idx2 (type, article_id, cnt);
DROP TABLE article;
CREATE TABLE article (id INT, cat_id INT);
@rubensayshi
rubensayshi / testcase.sql
Last active December 14, 2015 21:29
hmm, when doing a query with a JOIN and a WHERE, why does mysql only use an index for the JOIN part? Why does mysql chose to use the `idxa0` instead of using `idxa2`?
DROP TABLE article;
DROP TABLE cat;
CREATE TABLE cat (
id INT AUTO_INCREMENT,
weight INT,
PRIMARY KEY (`id`)
);
<?php
function extractHeaders($responseHeader) {
$responseCookies = array();
$responseHeaders = array();
$responseHeader = str_replace("\r\n", "\n", $responseHeader);
// explode and parse the headers
foreach (explode("\n", $responseHeader) as $line) {
$line = explode(':', $line, 2);
+-------------------------------------------------------------------------------------------------------------------------------------------------------+-------+
| link | total |
+-------------------------------------------------------------------------------------------------------------------------------------------------------+-------+
| http://www.nu.nl/binnenland/3391971/zondag-mogelijk-20-graden-in-nederland.html | 69665 |
| http://www.facebook.com/opelnederland | 60374 |
| http://www.facebook.com/opelnederland | 59988 |
| http://www.geenstijl.nl/mt/archieven/2013/01/terin
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
var bitutil = require('bitcore/util/util');
// ouput being spend: http://blockexplorer.com/tx/a4bfa8ab6435ae5f25dae9d89e4eb67dfa94283ca751f393c1ddc5a837bbc31b#o0
// taken from http://blockexplorer.com/tx/09f691b2263260e71f363d1db51ff3100d285956a40cc0e4f8c8c2c4a80559b1
var input = "0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A29AB5F49FFFF001D1DAC2B7C"
bitutil.twoSha256(input) // why isn't this 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 ?