Skip to content

Instantly share code, notes, and snippets.

View hibooboo2's full-sized avatar

James Jeffrey hibooboo2

View GitHub Profile
@hibooboo2
hibooboo2 / clock_spinner.go
Created September 15, 2017 03:42
A spinner for go, using clock emoji.
package main
import (
"time"
"github.com/janeczku/go-spinner"
)
func main() {
s := spinner.StartNew("This may take some while...")
@hibooboo2
hibooboo2 / shuffle.go
Last active September 14, 2017 23:12
Shuffle any thing golang. No funcs. Simple.
package main
func main() {
items := map[string]interface{}{
"boom": "man",
"sweet": "awesome",
"ok": "another",
"able": "able",
"about": "about",
"above": "above",
@hibooboo2
hibooboo2 / main.go
Created July 28, 2017 17:06
QL sample Error
package main
import (
"database/sql"
"fmt"
_ "github.com/cznic/ql/driver"
)
var tables = [...]string{`CREATE TABLE IF NOT EXISTS things (

Keybase proof

I hereby claim:

  • I am hibooboo2 on github.
  • I am wizardofmath (https://keybase.io/wizardofmath) on keybase.
  • I have a public key whose fingerprint is F402 0FF9 F8F3 E7D7 3D5F B9D3 A67F 3BFB 02C5 7B31

To claim this, I am signing this object:

@hibooboo2
hibooboo2 / notImplemented.go
Created June 3, 2016 23:05
Gist to make and return an error that you can use to represent a go function that is not yet implemented based on where the function is called from.
package dev
import (
"fmt"
"log"
"runtime"
"strings"
)
func notImplemented() error {
set -x
: ${PORT:=443}
: ${DOMAIN:=example.com}
openssl s_client -showcerts -connect ${DOMAIN}:${PORT} </dev/null 2>/dev/null|openssl x509 -outform PEM >ca.crt
sudo cp ca.crt /etc/docker/certs.d/${DOMAIN}/ca.crt
cat ca.crt | sudo tee -a /etc/ssl/certs/ca-certificates.crt
sudo service docker restart
@hibooboo2
hibooboo2 / bashArguments
Created February 6, 2015 19:47
How to get bash arguments and how to get path or name
# ------------- SCRIPT ------------- #
#!/bin/bash
echo
echo "# arguments called with ----> ${@} "
echo "# \$1 ----------------------> $1 "
echo "# \$2 ----------------------> $2 "
echo "# path to me ---------------> ${0} "
echo "# parent path --------------> ${0%/*} "
@hibooboo2
hibooboo2 / .gitconfig
Created March 3, 2014 21:58
From http://nvie.com/posts/a-successful-git-branching-model/ Start a new Branch. AND OTHER AUTO MAGIC THINGS AS ALIAIS
[core]
editor = gedit -w
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
@hibooboo2
hibooboo2 / folder.java
Created February 4, 2014 00:58
Make a folder.
void makeFolder(String folderLocation)
{
File f= new File(folderLocation);
try
{
if (f.mkdir())
{
System.out.println("Directory Created");
}
File logFile= new File(this.logFileName);
if (!logFile.exists())
{
try
{
logFile.createNewFile();
}
catch (IOException e)
{
System.out.println("IOExeception from writing to log. Can't access log file or make one.");