Skip to content

Instantly share code, notes, and snippets.

View gillesdemey's full-sized avatar
♥️
Be kind to others

Gilles De Mey gillesdemey

♥️
Be kind to others
View GitHub Profile
#!/usr/bin/bash
# start x, end y, collection z
# ie. get_nouns 2917 2951 "gestures"
function get_nouns {
working_dir = ~/Desktop/nouns/$3
for i in {$1..$2}
do
curl -L http://thenounproject.com/download/zipped/svg_$i.zip > $working_dir/svg_$i.zip
done
cd $working_dir
@gillesdemey
gillesdemey / gist:7397251
Created November 10, 2013 11:45
Tint2.rc
#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------
# For more information about tint2, see:
# http://code.google.com/p/tint2/wiki/Welcome
#
# For more config file examples, see:
# http://crunchbanglinux.org/forums/topic/3232/my-tint2-config/
# Background definitions

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

{
"bold_folder_labels": true,
"caret_style": "phase",
"default_line_ending": "unix",
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"rulers":
@gillesdemey
gillesdemey / querystring.swift
Last active March 24, 2021 10:53
Retrieve specific query string parameter from NSURL
func getQueryStringParameter(url: String, param: String) -> String? {
let url = NSURLComponents(string: url)!
return
(url.queryItems? as [NSURLQueryItem])
.filter({ (item) in item.name == param }).first?
.value()
}
var _ = require('lodash');
var exec = require('child_process').exec;
/**
* Get a list of NFS mounted drives
*/
function getMountedDrives(types, callback) {
function parseOut(err, stdout, stderr) {
@gillesdemey
gillesdemey / index.js
Last active May 10, 2016 00:54
Pino RingBuffer
var pino = require('./')
var RingBuffer = require('./ringbuffer')
var rb = new RingBuffer({ limit: 10 })
var log = pino(rb)
setInterval(() => {
log.info(new Date())
}, 5)
@gillesdemey
gillesdemey / server.go
Created June 12, 2016 17:25
HTTP to Kafka bridge
package main
import (
"fmt"
"log"
"net/http"
"github.com/Shopify/sarama"
"goji.io"
"goji.io/pat"

Keybase proof

I hereby claim:

  • I am gillesdemey on github.
  • I am gillesdemey (https://keybase.io/gillesdemey) on keybase.
  • I have a public key whose fingerprint is E6AA 852C 3B21 6897 7093 236B 632B 56C8 98C2 5A23

To claim this, I am signing this object:

// get tokens for provider from user (profile)
function getTokens (provider, profile) {
var tenant = options.globalSettings.HOARD_TENANT
var secret = options.globalSettings.HOARD_SECRET
var jwt_token = jwt.sign({ sub: profile, iss: tenant }, secret)
return request(`https://auth.waylay.io/tokens/${provider}`, {
headers: { 'authorization': jwt_token }
})