This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Based on answer from Gareth here: https://apple.stackexchange.com/questions/88396/forcing-the-wifi-password-entry-dialogue-to-display | |
// | |
#> ifconfig | |
// this will give you a list of MAC addresses | |
// or | |
#> sudo ifconfig en0 | |
// will give you a specific MAC address (you will be prompted for your system's admin password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* variation on https://medium.com/@DanHomola/react-higher-order-components-in-typescript-made-simple-6f9b55691af1 */ | |
import * as React from 'react' | |
import { wrapDisplayName } from 'recompose' | |
// Props you want the resulting component to take (besides the props of the wrapped component) | |
interface ExternalProps {} | |
// Props the HOC adds to the wrapped component | |
export interface InjectedProps {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<scheme name="Material Dark" version="142" parent_scheme="Darcula"> | |
<!-- | |
1. Install the Roboto Mono Regular font - https://fonts.google.com/specimen/Roboto+Mono?selection.family=Roboto+Mono | |
2. Copy `Material Dark.icls` to `~/Library/Preferences/AndroidStudio3.0/colors/` | |
3. Restart AS | |
4. Preferences > Editor > Color and Fonts > select Material Dark and press OK | |
--> | |
<option name="FONT_SCALE" value="1.0" /> |
Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex
command line tool.
To learn more about migrations, check out this article on the different types of database migrations!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/node | |
const Promise = require('bluebird') | |
const config = require('./config.json') | |
const knex = require('./lib/knex')(config.database).connection() | |
const mock = () => ({ user_id: Math.floor(Math.random() * 999) + 1, payload_type: 'foo', attributes: JSON.stringify({}) }) | |
const before = (t) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright (C) 2016 Arash Shams <https://github.com/Ara4Sh>. | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BPi restFull-api by @BenyaminSalimi | |
# you can see log of this program in "BPi.log" | |
from flask import Flask,jsonify,send_file | |
import picamera | |
import time | |
import RPi.GPIO as GPIO | |
app = Flask(__name__) |
Install 3scale self managed API gateway (openresty) in Mac OS-X
brew update
brew install pcre openssl
wget http://openresty.org/download/ngx_openresty-1.9.7.2.tar.gz
tar xzvf ngx_openresty-1.9.7.2.tar.gz
cd ngx_openresty-1.9.7.2
NewerOlder