Skip to content

Instantly share code, notes, and snippets.

Avatar
💝
tab tab tab...

r4wm R4wm

💝
tab tab tab...
View GitHub Profile
@R4wm
R4wm / golang-request
Last active Dec 12, 2020 — forked from kendellfab/golang-request
Golang Example for adding custom headers to a request.
View golang-request
package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
@R4wm
R4wm / ex1.7.scm
Created Jun 3, 2017
ex1.7 incomplete
View ex1.7.scm
#!/usr/bin/guile -s
!#
; define square
(define (square x) (* x x))
; define average
(define (average x y)
(/ (+ x y)2))
View gist:91c7318ebf92d2cbd3a33f1216f197db
>>> 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 Sep 17, 2017
iota example
View iota_example.go
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
)
View ectoken notes
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
View bufferedChannel.go
package main
import (
"fmt"
"sync"
)
var wg = sync.WaitGroup{}
func main() {
@R4wm
R4wm / gist_get_ip.sh
Last active May 15, 2018
Get your ip address
View gist_get_ip.sh
curl 'https://httpbin.org/get' | jq '.origin'
View forBucky.py
#!/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 Sep 20, 2018
simple script to sort files in local dir, can be changed to take arg or even walk directory
View sort_json.py
#!/usr/bin/env python
import os
import json
filelist = []
for i in os.listdir('.'):
if i.endswith(".json"):
filelist.append(i)