Skip to content

Instantly share code, notes, and snippets.

View sander's full-sized avatar

Sander Dijkhuis sander

View GitHub Profile
@sander
sander / __fonts.css.sass
Created May 6, 2014 21:42
Hosting web fonts in a subdirectory in Rails
// app/stylesheets/__fonts.css.sass
// Example, where fira-sans is a subdirectory of app/assets/fonts:
@font-face
font-family: 'Fira Sans'
src: asset_url('fira-sans/eot/FiraSans-Light.eot')
src: local('Fira Sans Light'), asset_url('fira-sans/eot/FiraSans-Light.eot') format('embedded-opentype'), asset_url('fira-sans/woff/FiraSans-Light.woff') format('woff'), asset_url('fira-sans/ttf/FiraSans-Light.ttf') format('truetype')
font-weight: 300
font-style: normal
@sander
sander / ms-settings.php
Created July 29, 2014 23:24
Fixing some strange issues with WordPress Multisite since 3.9?
<?php
/**
* Used to set up and fix common variables and include
* the Multisite procedural and class library.
*
* Allows for some configuration in wp-config.php (see ms-default-constants.php)
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
@sander
sander / mail-settings.php
Last active August 29, 2015 14:04
WordPress plugin to change the default From address multisite mails
<?php
// Plugin Name: Server settings
// Author: Sander Dijkhuis
add_filter( 'wp_mail_from', function() { return 'from.address@example.com' } );
add_filter( 'wp_mail_from_name', function() { return 'From Name'; } );
@sander
sander / run.sh
Created August 7, 2014 19:11
Installing CouchDB using Homebrew on OS X 10.10 Yosemite beta
brew install https://raw.githubusercontent.com/DomT4/Brew1010/master/Library/Formula/wxmac.rb
. ~/.profile
export ENV=/etc/profile
brew install couchdb
@sander
sander / gist:3099c6a26cf547e0b19d
Created January 20, 2015 07:38
Lein Sassc error
$ lein repl
nREPL server started on port 49956 on host 127.0.0.1 - nrepl://127.0.0.1:49956
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
Java HotSpot(TM) 64-Bit Server VM 1.7.0_45-b18
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
@sander
sander / NOTE.md
Created March 18, 2015 09:07
Experimenting with ClojureScript on a local server

If you are hosting index.html with a different server than the repl server (e.g. to serve images), load the main js file from localhost:9000. Otherwise reloading your ns won't work.

@sander
sander / log
Created May 16, 2015 20:12
CMake error in iotkit-lib-c
ERROR: Function failed: do_configure (log file is located at /home/sander/edison/edison-src/build/tmp/work/core2-32-poky-linux/iotkit-lib-c/1.4.8-r0/temp/log.do_configure.14194)
ERROR: Logfile of failure stored in: /home/sander/edison/edison-src/build/tmp/work/core2-32-poky-linux/iotkit-lib-c/1.4.8-r0/temp/log.do_configure.14194
Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: SITE files ['endian-little', 'bit-32', 'ix86-common', 'common-linux', 'common-glibc', 'i586-linux', 'common']
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing python function autotools_copy_aclocals
| DEBUG: Python function autotools_copy_aclocals finished
@sander
sander / devices
Last active August 29, 2015 14:21
Edison Arduino issue
# ls /dev/tty*
/dev/tty /dev/tty2 /dev/tty31 /dev/tty43 /dev/tty55 /dev/ttyACM0
/dev/tty0 /dev/tty20 /dev/tty32 /dev/tty44 /dev/tty56 /dev/ttyGS0
/dev/tty1 /dev/tty21 /dev/tty33 /dev/tty45 /dev/tty57 /dev/ttyMFD0
/dev/tty10 /dev/tty22 /dev/tty34 /dev/tty46 /dev/tty58 /dev/ttyMFD1
/dev/tty11 /dev/tty23 /dev/tty35 /dev/tty47 /dev/tty59 /dev/ttyMFD2
/dev/tty12 /dev/tty24 /dev/tty36 /dev/tty48 /dev/tty6 /dev/ttyPTI0
/dev/tty13 /dev/tty25 /dev/tty37 /dev/tty49 /dev/tty60 /dev/ttyPTI1
/dev/tty14 /dev/tty26 /dev/tty38 /dev/tty5 /dev/tty61 /dev/ttymcu0
/dev/tty15 /dev/tty27 /dev/tty39 /dev/tty50 /dev/tty62 /dev/ttymcu1
# DEBUG=* node test.js > ~/debugf
hci-ble hciBle = /home/root/fmp/node_modules/ancs/node_modules/noble/lib/linux/../../build/Release/hci-ble +0ms
hci-ble buffer = "adapterState poweredOn\n" +100ms
hci-ble line = adapterState poweredOn +2ms
hci-ble adapterState = poweredOn +2ms
noble stateChange poweredOn +0ms
noble scanStart +4ms
hci-ble buffer = "event 70:56:81:DA:26:11,public,02011a0bff4c000906" +64ms
hci-ble buffer = "event 70:56:81:DA:26:11,public,02011a0bff4c0009060203c0a8000b,-81\n" +2ms
hci-ble line = event 70:56:81:DA:26:11,public,02011a0bff4c0009060203c0a8000b,-81 +0ms
@sander
sander / hcidump
Created May 18, 2015 10:53
node-ancs issue
HCI sniffer - Bluetooth packet analyzer ver 5.24
device: hci0 snap_len: 1500 filter: 0xffffffff
< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7
type 0x01 (active)
interval 10.000ms window 10.000ms
own address: 0x00 (Public) policy: All
> HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Parameters (0x08|0x000b) ncmd 1
status 0x00
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2