View .fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
View assets.md

Assets library

View pi-motd.sh
#!/bin/bash
echo "$(tput setaf 2)
.~~. .~~.
'. \ ' ' / .'$(tput setaf 1)
.~ .~~~..~.
: .~.'~'.~. :
~ ( ) ( ) ~
( : '~'.~.'~' : )
~ .~ ( ) ~. ~
( : '~' : ) $(tput sgr0)Raspberry Pi$(tput setaf 1)
View load-script.js
function loadScript(url, callback)
{
// Adding the script tag to the head as suggested before
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
// Then bind the event to the callback function.
// There are several events for cross browser compatibility.
if (script.readyState){ //IE
View node-clustering.js
var cluster = require('cluster')
if (cluster.isMaster) {
console.log('Master cluster setting up ' + numWorkers + ' workers...')
cluster.on('online', worker => {
console.log('Worker ' + worker.process.pid + ' is online')
})
View if-not-exists.sql
-- SCHEMA
IF schema_id('TerminalRentControl') IS NULL
BEGIN
EXECUTE('CREATE SCHEMA [TerminalRentControl]')
END
-- TABLE
IF NOT (EXISTS (SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'TerminalRentControl'
View find-package-json.js
/**
* Find the closest package.json file, starting at process.cwd (by default),
* and working up to root.
*
* @param {string} [startDir=process.cwd()] Starting directory
* @returns {string} Absolute path to closest package.json file
*/
function findPackageJson(startDir) {
var dir = path.resolve(startDir || process.cwd());
View regexMultiMatch.js
function regexMultiMatch(str, regex, fn) {
// clone for no regex.lastIndex problems
var cloneRegExp = new RegExp(regex.source, regex.flags ||
(regex.global ? 'g' : '') + (regex.ignoreCase ? 'i' : '') + (regex.multiline ? 'm' : ''))
fn.apply(null, regex.exec(str))
if (regex.global) {
var match
while((match = regex.exec(str))) fn.apply(null, match)
View extract-table-names.js
const fs = require('fs');
fs.readFile(process.argv[2], 'utf8', (err,data) =>{
if (err) {
return console.log(err);
}
fs.writeFile(process.argv[3]+'.md', extractTableNames(data), err => {
if(err) {
console.log(err);
View add-remote-rsa-key.sh
#!/bin/sh
cat ~/.ssh/id_rsa.pub | (ssh user@host "cat >> ~/.ssh/authorized_keys")