Skip to content

Instantly share code, notes, and snippets.

View kylestev's full-sized avatar

Kyle Stevenson kylestev

  • Portland, Oregon
View GitHub Profile
@nzvtrk
nzvtrk / axiosInterceptor.js
Last active December 7, 2023 17:21
Axios create/recreate cookie session in node.js enviroment
/* Basic example of saving cookie using axios in node.js and session's recreation after expiration.
* We have to getting/saving cookie manually because WithCredential axios param use XHR and doesn't work in node.js
* Also, this example supports parallel request and send only one create session request.
* */
const BASE_URL = "https://google.com";
// Init instance of axios which works with BASE_URL
const axiosInstance = axios.create({ baseURL: BASE_URL });
@alexellis
alexellis / k8s-pi.md
Last active April 11, 2024 14:17
K8s on Raspbian
@TSedlar
TSedlar / clippy.sh
Created August 19, 2014 01:30
Bash script for uploading screenshots to imgur or clipboard content to pastie
#!/bin/bash
function get_clipboard_content {
xclip -selection c -o
}
function upload_pastie {
local lang="plain_text"
local content=$(get_clipboard_content)
local private=1
@bruno-
bruno- / gist:eddd6298deaa4940c52c
Created August 13, 2014 19:05
signing git commits - cheat sheet

Article: http://mikegerwitz.com/papers/git-horror-story

Theory

  • faking other user's commits is easy with --author flag $ git commit --author='Foo Bar <foo@bar.com>' -m 'some commit'

  • signing commits ensures:

    • someone else can't commit as myself
  • I really commited all the commits I sign

package us.brtm.cfg;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.analysis.*;
import us.brtm.cfg.generic.Node;
/**
* @author Pedro Daia Cardoso
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 7, 2024 06:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@codification
codification / graphite-client.py
Last active April 29, 2019 17:21
Graphite client in python
import time
import socket
def collect_metric(name, value, timestamp):
sock = socket.socket()
sock.connect( ("localhost", 2003) )
sock.send("%s %d %d\n" % (name, value, timestamp))
sock.close()
def now():
return int(time.time())