Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
#!/usr/bin/env ruby | |
require 'spreadsheet' | |
# Begin Test | |
print "Spreadsheet Test\n" | |
# Create the rows to be inserted | |
row_1 = ['A1', 'B1'] | |
row_2 = ['A2', 'B2'] |
app.filter('bytes', function() { | |
return function(bytes, precision) { | |
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; | |
if (typeof precision === 'undefined') precision = 1; | |
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'], | |
number = Math.floor(Math.log(bytes) / Math.log(1024)); | |
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number]; | |
} | |
}); |
// Make our app module, its easier to do this in raw javascript | |
// and then put the rest of our app content (controllers etc) | |
// in their own coffeescript files. | |
// | |
// Your ng-app should include this module name, eg: <html ng-app="TodoApp"> | |
angular.module('TodoApp', []); |
app.directive('ngFocus', ['$parse', function($parse) { | |
return function(scope, element, attr) { | |
var fn = $parse(attr['ngFocus']); | |
element.bind('focus', function(event) { | |
scope.$apply(function() { | |
fn(scope, {$event:event}); | |
}); | |
}); | |
} | |
}]); |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
public class AccountAuthenticator extends AbstractAccountAuthenticator { | |
private final Context context; | |
@Inject @ClientId String clientId; | |
@Inject @ClientSecret String clientSecret; | |
@Inject ApiService apiService; | |
public AccountAuthenticator(Context context) { | |
super(context); |
# This enables a publicly available server to forward connections to your computer behind a NAT. | |
# So if you access http://xx.xx.xx.xx:8080/ on your browser, traffic is redirected to your machine behind a NAT. | |
# on your local host, type: | |
ssh -R xx.xx.xx.xx:8888:localhost:80 root@xx.xx.xx.xx | |
# now wait for your shell, and type: | |
socat TCP-LISTEN:8080,FORK TCP:127.0.0.1:8888 | |
# This command outputs nothing, just keep it running. While you don't ^C, your tunnel is up and running! |
The Z-Stick does bi-directional communication over a UART. The connection speed is 115200, '8N1'. There are "requests" and "responses". The client software can make requests to the Z-Stick, and it will send responses. But it seems the Z-Stick can make requests of the client software too. I have yet to figure out the requests the Z-Stick sends to the client software.
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
brew unlink postgresql | |
brew install postgresql@9.6 | |
brew unlink postgresql@9.6 | |
brew link postgresql |