Skip to content

Instantly share code, notes, and snippets.

View seppestas's full-sized avatar

Seppe Stas seppestas

View GitHub Profile
@seppestas
seppestas / Tmux mouse-mode
Created April 9, 2013 10:10
Lines to put in .tmux.conf to turn on mouse-mode. This allows you to use the mouse (and touchscreens) to select the active window, navigate in the window,...
# Turn mouse-mode on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
@seppestas
seppestas / gist:f7fd26b54104c30a848f
Created June 29, 2015 12:39
Network discovery Opera
navigator.getNetworkServices(['upnp:urn:schemas-upnp-org:service:ContentDirectory:1',], function(serviceList) {console.log('got services: '); console.log(serviceList); }, function(e) {console.log('error:' + e.message);} )
@seppestas
seppestas / awslambda.mk
Last active February 12, 2017 19:40
AWS Lambda deployment package maker
# Copyright (c) Productize
# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Free Software Foundation.
# You can get the license at <http://www.gnu.org/licenses/gpl.html>
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@seppestas
seppestas / # gst-plugins-bad - 2016-05-09_10-35-17.txt
Created May 9, 2016 09:00
gst-plugins-bad on Mac OS X 10.11.4 - Homebrew build logs
Homebrew build logs for gst-plugins-bad on Mac OS X 10.11.4
Build date: 2016-05-09 10:35:17

Keybase proof

I hereby claim:

  • I am seppestas on github.
  • I am seppestas (https://keybase.io/seppestas) on keybase.
  • I have a public key whose fingerprint is 1EEA B396 EECA 267E 0F5B 6C2E FECE AA3E ECF4 C38F

To claim this, I am signing this object:

package stuff
import (
"github.com/stretchr/testify/mock"
"testing"
)
// Interface to mock
type Stuff interface {
DoThings(fu, bar string) (string, error)
// Module to talk to the SHT21 temperature and humidity sensor over I2C
var i2c = require('i2c');
// Register addresses
const TRIGGER_T_MEASUREMENT_NO_HOLD = 0xF3;
const TRIGGER_RH_MEASUREMENT_NO_HOLD = 0xF5;
const WRITE_USER_REGISTER = 0xE6;
const READ_USER_REGISTER = 0xE7;
const SOFT_RESET = 0xFE;
@seppestas
seppestas / get-n-last-chars-foo.sh
Last active March 14, 2018 14:53
Get the last $n characters of a variable $foo in a posix-compatible shell
${foo:$((${#foo}-$n))}
@seppestas
seppestas / kicad-cmake-macos.sh
Created May 1, 2018 22:59
cmake command to set up KiCad MacOS build
cmake -DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${$(defaults read loginwindow SystemVersionStampAsString)%.*} \
-DwxWidgets_CONFIG_EXECUTABLE=/usr/local/opt/kicad-wxwidgets/bin/wx-config \
-DKICAD_SCRIPTING=ON \
-DKICAD_SCRIPTING_MODULES=ON \
-DKICAD_SCRIPTING_WXPYTHON=ON \
-DKICAD_SCRIPTING_ACTION_MENU=ON \
-DPYTHON_EXECUTABLE=/usr/local/bin/python2 \
-DPYTHON_SITE_PACKAGE_PATH=/usr/local/opt/kicad-wxpython/lib/python2.7/site-packages \
var xhr = new XMLHttpRequest();
xhr.open('POST', './mac-address', true);
var formData = new FormData();
formData.append('mac-address', mac);
xhr.send(formData);