Skip to content

Instantly share code, notes, and snippets.

@bryfox
bryfox / api-spec-0.0.0.json
Created June 4, 2018 17:42
Example device API spec for Network Canvas Server
{
"host": "localhost:51001",
"basePath": "/",
"schemes": [
"http"
],
"info": {
"title": "Network Canvas Devices API",
"description": "REST API for paired tablet & desktop clients",
"version": "0.0.0"
@bryfox
bryfox / network-canvas-desktop-app-notes.md
Created April 25, 2018 13:53
Notes on workflow, etc. for electron apps (Network Canvas)

Dev workflow

The approach I use is documented in the readme. I develop from electron, rather than standalone server + browser (though the latter is still supported for work not requiring IPC.) It's working well enough that I haven't rushed to implement webpack/livereload.

  • main is still copied, not webpacked.
    • Webpack + HMR is still on my TODO list. (It's possible, but I haven't finished. Though should be easier without a separate worker process now...)
  • ...So changes to main require restarting manually.
    • On the plus side, 'build' is effectively just a cp -R, and startup is reasonably fast
  • I haven't felt the need yet, but you can install react & redux devtools extensions in electron if desired. That's the only thing missing vs. browser dev, IMHO.
@bryfox
bryfox / Vagrantfile
Created February 9, 2018 15:57
vagrantfile for ubuntu + nodejs (because jest not running in macOS)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@bryfox
bryfox / errno-codes.h
Created August 31, 2017 14:05
linux error numbers
// see /usr/include/asm-generic/errno-base.h
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Argument list too long */
#define ENOEXEC 8 /* Exec format error */
@bryfox
bryfox / dnsmasq.md
Created June 15, 2017 20:10 — forked from nickcernis/dnsmasq.md
dnsmasq

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.

Requirements

Install

@bryfox
bryfox / wiki.lua
Created February 7, 2017 20:15 — forked from zhzhxtrrk/wiki.lua
pandoc confluence markup writer
-- that is very similar to that of pandoc's HTML writer.
-- There is one new feature: code blocks marked with class 'dot'
-- are piped through graphviz and images are included in the HTML
-- output using 'data:' URLs.
--
-- Invoke with: pandoc -t sample.lua
--
-- Note: you need not have lua installed on your system to use this
-- custom writer. However, if you do have lua installed, you can
-- use it to test changes to the script. 'lua sample.lua' will
#!/bin/bash
# usage :
# generate-iOS-app-icons.sh someDir/sourceImage-1024x1024.png path/where/ImagesAssets/is/located
mkdir -p generated
# you'll have to delete this one after executing the script if you copy the generated images in the Images asset
SOURCE_ICON="$1"
PATH_TO_IMAGES_ASSET="$2"
@bryfox
bryfox / drag_and_drop_helper.js
Created March 30, 2016 21:27 — forked from rcorreia/drag_and_drop_helper.js
drag_and_drop_helper.js
(function( $ ) {
$.fn.simulateDragDrop = function(options) {
return this.each(function() {
new $.simulateDragDrop(this, options);
});
};
$.simulateDragDrop = function(elem, options) {
this.options = options;
this.simulateEvent(elem, options);
};
@bryfox
bryfox / angularjs_directive_attribute_explanation.md
Created December 5, 2015 00:48 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@bryfox
bryfox / geolocation-cross-platform.txt
Created August 27, 2014 01:44
Old (ca. 2011) notes on improving geolocation for mobile devices/web browsers.
1. iPhone
* Make sure you have a strong signal and good coverage
* Enable Location Services for Safari in the Settings menu
* Make sure to allow the geolocation when prompted.
2. Android.
* Make sure you have a strong signal and good coverage
* Some devices, such as some versions of the Galaxy S, are known to
have geolocation problems.
* From the device settings menu, make sure the following settings are available