Skip to content

Instantly share code, notes, and snippets.

View thomasbrueggemann's full-sized avatar
👨‍💻

Thomas Brüggemann thomasbrueggemann

👨‍💻
View GitHub Profile
@themanifold
themanifold / node-prune.sh
Last active October 1, 2022 02:47
Pruning useless node_modules with bash userland tools (find etc)
#!/usr/bin/env bash
find node_modules \( -name '__tests__' -o \
-name 'test' -o \
-name 'tests' -o \
-name 'powered-test' -o \
-name 'docs' -o \
-name 'doc' -o \
-name '.idea' -o \
-name '.vscode' -o \
-name 'website' -o \
@eveningkid
eveningkid / how-to-use-react-intl.md
Created July 28, 2017 16:33
How To Use React-Intl: internationalize your React app

How To Use React-Intl: internationalize your React app

This short tutorial assumes you know about ES6 syntax.

Get started

yarn add react-intl or npm i --save react-intl.

Create a messages file

This file should contain every message for your app.
It has an object of (locale, messages) couples:

@manuelroth
manuelroth / index.js
Last active May 18, 2023 07:51
A very simple node.js server for serving vector tiles from an mbtiles file
var express = require("express"),
app = express(),
MBTiles = require('mbtiles'),
p = require("path");
// Enable CORS and set correct mime type/content encoding
var header = {
"Access-Control-Allow-Origin":"*",
"Access-Control-Allow-Headers":"Origin, X-Requested-With, Content-Type, Accept",
"Content-Type":"application/x-protobuf",
@ba55ie
ba55ie / client.js
Last active February 20, 2019 07:11
Node.js SignalR V2.2.0 client
'use strict';
const jsdom = require('jsdom');
const window = jsdom.jsdom().defaultView;
const url = 'http://YOUR_SIGNALR_URL'; // Used for CORS
const hubs = 'http://YOUR_SIGNALR_HUBS_URL';
function loadScript(src) {
return new Promise((resolve, reject) => {
@ummjackson
ummjackson / Peach v1 API Endpoints.md
Last active February 8, 2024 18:27
Peach v1 API Endpoints

Peach (peach.cool) API Endpoints

Peach is hot right now so I poked around their API using https://mitmproxy.org/

As of the last update, this seems to be a fairly extensive/complete list of v1 endpoints, but feel free to submit revisions to this gist with any others you find!

Login

@wenzhixin
wenzhixin / ubuntu14.04-command-line-install-android-sdk
Last active July 4, 2024 05:29
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
@minwe
minwe / EventSystem.js
Last active October 22, 2019 03:03 — forked from yitsushi/EventSystem.js
Global event system for React.js
var EventSystem = (function() {
var self = this;
self.queue = {};
return {
publish: function (event, data) {
var queue = self.queue[event];
if (typeof queue === 'undefined') {
@geobabbler
geobabbler / MBTilesProvider.cs
Created February 25, 2014 17:13
Simple class to access MBTiles in C#
public class MBTilesProvider
{
public GeoExtent Bounds { get; private set; }
public CoordinatePair Center { get; private set; }
public int MinZoom { get; private set; }
public int MaxZoom { get; private set; }
public string Name { get; private set; }
public string Description { get; private set; }
public string MBTilesVersion { get; private set; }
public string Path { get; private set; }
@victorreyesh
victorreyesh / Aircrack Commands
Created September 12, 2013 03:36
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
//Install Macports.
//Install aircrack-ng:
sudo port install aircrack-ng
//Install the latest Xcode, with the Command Line Tools.
//Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
//Figure out which channel you need to sniff:
sudo airport -s
sudo airport en1 sniff [CHANNEL]
@thomasbrueggemann
thomasbrueggemann / sinus_sleeper.py
Last active December 11, 2015 09:48
Distributes the sleeping time of a script over the 24 hours of a day, so that at the zenith the max_time will be waited and 12 hours later 1 second will be waited. That gives to opportunity to set the zenit to the hour of the day that to least traffic will be expected (e.g. 3am). This could be interesting to any kind of long running scripts that…
from datetime import datetime
import math, time
#
# SINUS SLEEPER
#
# max_time: maximum seconds to sleep at the zenith hour
# zenith : hour (0-23) of day at which the max_time value is reached
#
def sinus_sleeper(max_time=120, zenith=0):