Skip to content

Instantly share code, notes, and snippets.

View R4wm's full-sized avatar
💝
tab tab tab...

r4wm R4wm

💝
tab tab tab...
View GitHub Profile
@R4wm
R4wm / golang-request
Last active December 12, 2020 04:33 — forked from kendellfab/golang-request
Golang Example for adding custom headers to a request.
package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
@R4wm
R4wm / ex1.7.scm
Created June 3, 2017 00:48
ex1.7 incomplete
#!/usr/bin/guile -s
!#
; define square
(define (square x) (* x x))
; define average
(define (average x y)
(/ (+ x y)2))
>>> def fib(n):
... if n > 3:
... return fib(n -1) + (fib(n-2) * 2) + (fib(n-3) * 3)
... else:
... return n
...
>>> fib(9)
696
@R4wm
R4wm / iota_example.go
Last active September 17, 2017 18:27
iota example
package main
import "fmt"
//using iota to declare value and inc
const (
A1 = iota //Start at 0
B1 = iota //Inc by 1
C1 = iota //Inc by 1
)
@R4wm
R4wm / ectoken notes
Last active December 29, 2017 17:03
cd ~/git
git clone https://github.com/bungle/lua-resty-nettle.git
git clone https://github.com/bungle/lua-resty-random
git clone https://github.com/r4wm/ectoken
cd ~/Downloads
wget https://openresty.org/download/openresty-1.11.2.5.tar.gz
wget https://www.openssl.org/source/openssl-1.0.2n.tar.gz
wget https://ftp.gnu.org/gnu/nettle/nettle-3.4.tar.gz
#make install openssl and nettle
package main
import (
"fmt"
"sync"
)
var wg = sync.WaitGroup{}
func main() {
@R4wm
R4wm / gist_get_ip.sh
Last active May 15, 2018 21:37
Get your ip address
curl 'https://httpbin.org/get' | jq '.origin'
#!/usr/bin/python
#Learn what sys.exit does in python
import sys
#This returns a LIST of the args passed
users_args = sys.argv[1:]
print "I see these args: ", users_args
@R4wm
R4wm / sort_json.py
Created September 20, 2018 16:31
simple script to sort files in local dir, can be changed to take arg or even walk directory
#!/usr/bin/env python
import os
import json
filelist = []
for i in os.listdir('.'):
if i.endswith(".json"):
filelist.append(i)