One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
// i9e (interpolate) parameters into string | |
export const i9eStr = (baseStr = '', params = {}) => { | |
const interpolatables = /\{(\w+?)\}/g; | |
let i9edStr = baseStr; | |
(baseStr.match(interpolatables) || []).forEach((hit) => { | |
const hitKey = hit.substring(1, hit.length - 1); | |
i9edStr = i9edStr.replace(hit, params[hitKey] || ''); | |
}); |
// helper method to search for an argument passed to node app | |
// rules: arguments must be preceded with '--' characters to be recognized as parameter | |
// example: node apps.js --port=2134 host=2312 --force ('host' won't be recognized, 'force' | |
// will be recognized and returns 'true') | |
const _findargs = (name) => { | |
const args = process.argv.slice(2); const param = args.find((el) => el.startsWith(`--${name}`)) | |
if (!param) return null | |
if (param.indexOf('=') === -1) return 'true' | |
return param.replace(`--${name}=`, '') |
/* | |
******************************************************************************** | |
Golang - Asterisk and Ampersand Cheatsheet | |
******************************************************************************** | |
Also available at: https://play.golang.org/p/lNpnS9j1ma | |
Allowed: | |
-------- | |
p := Person{"Steve", 28} stores the value |
package some_test | |
import ( | |
"testing" | |
) | |
// Credits to (Cory Jacobsen) from this file here https://github.com/unrolled/render/blob/7fc1b8f68b9beddc94385fd212c293caf729277a/render_test.go#L44 | |
/* Test Helper */ | |
func expect(t *testing.T, a interface{}, b interface{}) { |
package main | |
import ( | |
"fmt" | |
"regexp" | |
"time" | |
) | |
const ParamsRegexPattern = "(:[\\w_]+)" |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
<meta http-equiv='X-UA-Compatible' content='IE=edge'> | |
<title>Coordinates from Line - results shown in log</title> | |
<meta name='viewport' content='width=device-width, initial-scale=1'> | |
<script src='./index.js'></script> | |
</head> |
package govalidatorhumanizer // you can change this | |
import ( | |
"fmt" | |
"strings" | |
ut "github.com/go-playground/universal-translator" | |
en_translations "gopkg.in/go-playground/validator.v9/translations/en" | |
"github.com/go-playground/locales/en" |
const vocal_list = ["i", "u", "e", "o"]; | |
const ignore_list = [" ", "-", "+", "-", "=", "(", ")"]; | |
const mapper = { | |
ng: "ع", | |
ny: "ۑ", | |
0: "٠", | |
1: "١", | |
2: "٢", | |
3: "٣", | |
4: "٤", |
package main | |
import ( | |
"fmt" | |
"math" | |
"math/rand" | |
"strings" | |
"time" | |
) |