Skip to content

Instantly share code, notes, and snippets.

:octocat:
Hello world!

Wouter De Schuyter wouterds

:octocat:
Hello world!
Block or report user

Report or block wouterds

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
@wouterds
wouterds / Dockerfile
Created Aug 3, 2019
Phantomjs support for Nodejs Alpine Docker container
View Dockerfile
ENV PHANTOMJS_VERSION 2.1.1
RUN apk add --update --no-cache curl && \
curl -Ls https://github.com/dustinblackman/phantomized/releases/download/${PHANTOMJS_VERSION}/dockerized-phantomjs.tar.gz | tar xz -C / && \
curl -k -Ls https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2 | tar -jxvf - -C . && \
cp phantomjs-${PHANTOMJS_VERSION}-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs && \
rm -fR phantomjs-${PHANTOMJS_VERSION}-linux-x86_64 && \
apk del curl
@wouterds
wouterds / samples.sql
Last active Jul 17, 2019
I want to select data between day x and day y returned as z amount of rows (scaled down data set).
View samples.sql
CREATE TABLE IF NOT EXISTS `samples` (
`id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`value` float(8,2) NOT NULL,
`createdAt` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `samples_created_at` (`createdAt`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `samples` (`id`, `value`, `createdAt`)
VALUES
View mysql-new-user.sql
CREATE USER 'user'@'host' IDENTIFIED BY 'pass';
GRANT ALL PRIVILEGES ON `db`.* TO 'user'@'host' IDENTIFIED BY 'pass';
FLUSH PRIVILEGES;
View hashids.js
import Hashids from 'hashids';
const hashids = new Hashids(
process.env.HASHIDS_SALT,
4,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890',
);
export const encode = (id: number): string => hashids.encode(id);
export const decode = (id: string): number | null => {
View debugging-tsl2561-zero-value.sql
SELECT
sensors.type,
samples.value,
DATE_FORMAT(
CONVERT_TZ(
samples.createdAt,
'+00:00',
'+01:00'
),
'%Y-%m-%d %h:%i %p'
View esp8266-tsl2561.ino
#include <Wire.h>
#include <ESP8266WebServer.h>
#include <TSL2561.h>
const char *ssid = "Wouter's Place";
const char *password = "";
ESP8266WebServer server(80);
TSL2561 tsl2561(TSL2561_ADDR_FLOAT);
View esp8266-led-control-webserver.ino
#include <Wire.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#define LED D1
const char *ssid = "Wouter's Place";
const char *password = "";
View wemos-d1-mini-blink.ino
View kelloggs-tresor-drone-bruteforce.js
const axios = require('axios');
const chalk = require('chalk');
const sleep = require('await-sleep');
const checkCode = async (code) => {
const codes = [code];
const response = await axios.post('https://winadrone.kelloggs.com/api/nl_BE/redemption/validate-codes', { codes });
const { data } = response;
View sixpair.c
/*
* sixpair.c version 2007-04-18
* Modified to run on Mac OSX by
* Erlend Cleveland 2011-09-04
*
* Compile with: gcc -o sixpair sixpair.c -lusb
*/
#include <string.h>
#include <unistd.h>
You can’t perform that action at this time.