Skip to content

Instantly share code, notes, and snippets.

View gist:b317169710db91127a29471c7eafeef7
// Fontawesome 5 with Nuxtjs and Bulma
// Revised version of https://medium.com/@kkostov/adding-bulma-with-fontawesome-to-a-nuxt-js-project-bd101adb8778
```
$ npm i bulma @fortawesome/fontawesome-free
```
`nuxt.conf.js`
```
/*
View welcome-flow-ja.json
[
{
"id": "b95be41e.e579a8",
"type": "tab",
"label": "サンプルフロー"
},
{
"id": "e5827617.1a7d88",
"type": "ui_tab",
"z": "b95be41e.e579a8",
View welcome-flow.json
[
{
"id": "b95be41e.e579a8",
"type": "tab",
"label": "Welcome Flow"
},
{
"id": "e5827617.1a7d88",
"type": "ui_tab",
"z": "b95be41e.e579a8",
@dbaba
dbaba / start_haproxy.sh
Last active Dec 2, 2015
A bash script for running HAProxy as a Docker container with hot reloading support
View start_haproxy.sh
#!/usr/bin/env bash
# A bash script for running HAProxy as a Docker container with hot reloading support
#
# For example:
# $ docker run --name lb -p 80:8080 -p 443:8443 \
# --log-driver=json-file --log-opt max-size=100M \
# --log-opt max-file=1 \
# -v $(pwd):/usr/local/etc/haproxy -tid \
# haproxy:1.6 /usr/local/etc/haproxy/start_haproxy.sh
@dbaba
dbaba / install-nodejs-rpi.sh
Created Oct 21, 2015
Installing Node.js v4.0.0+ on Raspberry Pi
View install-nodejs-rpi.sh
#!/usr/bin/env bash
# v4.0.0+ is available
VERSION=v4.1.2
# Set armv7l for RPi2
ARCH=armv6l
wget https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-${ARCH}.tar.gz
tar xf node-${VERSION}-linux-${ARCH}.tar.gz
rm -f node-${VERSION}-linux-${ARCH}/*
View install-JavaScriptNext-tmbundle.sh
#!/usr/bin/env sh
curl -L -O https://raw.githubusercontent.com/dhensche/JavaScriptNext.tmLanguage/master/create-bundle.sh
curl -L -O https://raw.githubusercontent.com/dhensche/JavaScriptNext.tmLanguage/master/yaml-to-plist.rb
curl -L -O https://raw.githubusercontent.com/dhensche/JavaScriptNext.tmLanguage/master/info.plist
chmod 755 create-bundle.sh
chmod 755 yaml-to-plist.rb
./create-bundle.sh
View peripheral-explorer.js
// perform `npm install noble async` prior to running this.
var async = require('async');
var noble = require('noble');
var peripheralId = process.argv[2];
noble.on('stateChange', function(state) {
if (state === 'poweredOn') {
noble.startScanning([], true);
} else {
View advertisement-discovery.js
// perform `npm install noble` prior to running this.
var noble = require('noble');
noble.on('stateChange', function(state) {
if (state === 'poweredOn') {
noble.startScanning([], true);
} else {
noble.stopScanning();
}
});
@dbaba
dbaba / beforeeach.js
Created Sep 29, 2015
sinon-chrome0.2.1 with PhantomJS 2.0.0 workaround for an issue where PhantomJS ignores chai's AssertionError.
View beforeeach.js
// sinon-chrome (https://github.com/vitalets/sinon-chrome/blob/master/example/test/beforeeach.js)
var fs = require('fs');
var page;
var beforeLoadFn;
beforeEach(function() {
page = require('webpage').create();
/**
* evaluate a function in the page
* @param {function} func the function to evaluate
@dbaba
dbaba / gist:b6318772c6d67d3eba24
Created Dec 11, 2014
Fetching TXT records with dnsjava
View gist:b6318772c6d67d3eba24
final Lookup lookup = new Lookup("my-txt.example.com", Type.TXT);
lookup.setResolver(new SimpleResolver());
lookup.setCache(null);
final Record[] records = lookup.run();
if (lookup.getResult() == Lookup.SUCCESSFUL) {
final StringBuilder builder = new StringBuilder();
for (Record record : records) {
final TXTRecord txt = (TXTRecord) record;
builder.delete(0, builder.length());
for (@SuppressWarnings("unchecked")
You can’t perform that action at this time.