Skip to content

Instantly share code, notes, and snippets.

☠️
Literally dead

Grim GrimTheReaper

☠️
Literally dead
  • Hiding in a panic room.
Block or report user

Report or block GrimTheReaper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@GrimTheReaper
GrimTheReaper / opened.go
Last active Nov 18, 2019
This package will tell you whether or not a golang application was opened in the terminal. Very useful for `fyne` or any other UI libs, when you plan on having both a GUI and a CLI. We're using this to make an app that can be used heedlessly, for the advanced users, and with a GUI using fyne so the less experienced users can use the tool too.
View opened.go
// +build windows
package opened
import (
"syscall"
"unsafe"
)
// <Unsafe>
@GrimTheReaper
GrimTheReaper / RequestMade.go
Last active Jan 15, 2018
Partially Blind Unmarshaling with Golang.
View RequestMade.go
package triggertypes
import "time"
// RequestMade ...
type RequestMade struct {
Requester int `json:"requester"` // sapphire userID
RequestID int `json:"requestID"`
EventID int `json:"eventID"`
CreatedDate *time.Time `json:"createdDate"` // Here just incase its lost or delayed.
@GrimTheReaper
GrimTheReaper / main.cpp
Created Aug 31, 2017 — forked from nikotan/main.cpp
face detection sample code for OpenCV
View main.cpp
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <opencv/ml.h>
void doMosaic(IplImage* in, int x, int y,
int width, int height, int size);
int main (int argc, char **argv)
{
int i, c;
@GrimTheReaper
GrimTheReaper / gist:3aa6a609d9073d04819dff27e9a4d3a7
Created Apr 11, 2017 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
View gist:3aa6a609d9073d04819dff27e9a4d3a7
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@GrimTheReaper
GrimTheReaper / Preparse.go
Last active Dec 5, 2016
Preparsing JSON
View Preparse.go
// Example of how to preparse a JSON String.
// Useful if the json is massive and what you are looking for is on the top.
//
// Use:
// preParseString(JSONKey, JSONBody) => Value of JSONKey, or "" if not found.
//
func preParseString(key string, body []byte) string {
var buffer []byte
level := 0
qO := false // quoteOpen
@GrimTheReaper
GrimTheReaper / ssh.go
Created May 24, 2016 — forked from jordic/ssh.go
golang mysql throught a tunnel
View ssh.go
package main
// based on gist
// https://gist.github.com/ir4y/11146415
// http://stackoverflow.com/questions/21417223/simple-ssh-port-forward-in-golang
// obro conexio ssh amb el server remot.
// tot el que envio al port local ho copio al port remote
// a traves de la conexio remota. Per tant he d'obrir un
// port a la maquina remota?
@GrimTheReaper
GrimTheReaper / FileReduce.java
Last active Mar 4, 2016
I unarchived in the wrong folder and since I know java better than batch (it first happened on windows) i wrote this to deal with it (rewritten on my phone out of boredum).
View FileReduce.java
public class main {
public static void main(String[] args) {
resonate("/home/user/Pictures/Archives","/home/user/Pictures");
}
public static void resonate(String lists, String reduce){
File f1 = new File(lists);
if (f1.exists() && f1.isDirectory()){
for (File f2: f1.listFiles()){
File f3 = new File(reduce+"/"+f2.getName());
View RemoveFromArray.go
package main
import "fmt"
func main() {
s := []string{"pig", "big", "sig", "pig", "lig", "tig", "pig", "sig", "kig", "pig"}
s = removeString(s, "pig")
fmt.Println(s)
}
View RemovePartOfArray.go
package main
import "fmt"
func main() {
a := []string{"arrays", "are", "go away", "fun"}
i := 2
a = append(a[:i], a[i+1:]...)
fmt.Println(a)
}
View LargestNumber.go
package main
import "fmt"
func main() {
lg, positions := largestNumber([]int{71, 114, 105, 109, 84, 104, 101, 82, 101, 97, 112, 101, 114})
fmt.Printf("Largest Number: %v\n", lg)
fmt.Print("Positions: ")
You can’t perform that action at this time.