Spin up the VM with
$vagrant up
then,
$psql -U postgres -W -h 127.0.0.1
# | |
# Ledger Nano S | |
# | |
# USB connection fix for Ubuntu 18.04.5 | |
# This script will create "/etc/udev/rules.d/20-hw1.rules" and restart udev. | |
# | |
# @reference https://support.ledger.com/hc/en-us/articles/115005165269-Fix-connection-issues | |
# | |
wget -q -O - https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/add_udev_rules.sh | sudo bash |
ask_password: | |
@$(eval PASSWORD=$(shell stty -echo; read -p "Password: " pwd; stty echo; echo $$pwd)) | |
echo $(PASSWORD) | |
ask_password_twice: | |
while true; do \ | |
read -s -p "Password: " password; \ | |
echo; \ | |
read -s -p "Password (again): " password2; \ |
// | |
// Convert an Excel-style column name to a number. | |
// | |
// Code: Hiroshi Yamamoto | |
function colNameToNum(name) { | |
var colNum = 0; | |
var pow = 1; | |
var i = name.length; | |
while(i--) { |
/** | |
* Returns a hash code for a string. | |
* (Compatible to Java's String.hashCode()) | |
* | |
* The hash code for a string object is computed as | |
* s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] | |
* using number arithmetic, where s[i] is the i th character | |
* of the given string, n is the length of the string, | |
* and ^ indicates exponentiation. | |
* (The hash value of the empty string is zero.) |
var scroll = { | |
iterr: 30, // miliseconds | |
tm: null, | |
reset_timer: function () { // reset | |
if (this.tm) { | |
clearTimeout(this.tm); | |
this.tm = null; | |
} | |
this.iterr = 30; | |
}, |
#include <stdio.h> | |
#define N 9 | |
main(k){for(k--;k<N*N;k++)printf("%2d%c",(k/N+1)*(k%N+1),(k+1)%N?32:10);} |
@echo off | |
:loop | |
evil_substance.exe | |
timeout /t 3600 >null | |
Taskkill /F /IM evil_substance.exe >null | |
goto loop |
#!/bin/sh | |
############################## | |
# ack_2_html (script example) | |
############################## | |
# Description: | |
# Perform an ack search then create a colorized HTML document. | |
# Usage: | |
# ack_2_html.sh OUTPUTFILE_NAME PART_OF_FILEPATH PART_OF_TEXT | |
# Dependency: |
if (!String.prototype.levenstein) { | |
String.prototype.levenstein = (function(string) { | |
// source originated from https://gist.github.com/andrei-m/982927#gistcomment-1797205 | |
var a = this, b = string + "", m = [], i, j, min = Math.min; | |
if (!(a && b)) return (b || a).length; | |
for (i = 0; i <= b.length; m[i] = [i++]); | |
for (j = 0; j <= a.length; m[0][j] = j++); |