Skip to content

Instantly share code, notes, and snippets.

@huyng
huyng / reflect.py
Created February 7, 2011 17:57
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@mjangda
mjangda / sync-svn-folders.sh
Created December 30, 2011 16:35
Sync files between two SVN folders
#!/bin/bash
# Script Name: Sync SVN folders
# Description: Use this script to sync changes from one SVN folder to another. A common use is syncing between prod and preprod repos.
# Tags: svn, sync
# Usage: ./sync-svn-folders.sh /path/to/from-repo /path/to/to-repo
FROM_REPO=$1
TO_REPO=$2
# Check that we don't have empty paths
@mauris
mauris / gist:5558889
Created May 11, 2013 04:27
Sample BitBucket payload for hook services
{
"canon_url": "https:\/\/bitbucket.org",
"commits": [
{
"author": "mauris",
"branch": "master",
"files": [
{
"file": "test",
"type": "added"
@n00neimp0rtant
n00neimp0rtant / gist:9515611
Last active March 14, 2024 06:30
simple squash without rebase
## within current branch, squashes all commits that are ahead of master down into one
## useful if you merged with upstream in the middle of your commits (rebase could get very ugly if this is the case)
## commit any working changes on branch "mybranchname", then...
git checkout master
git checkout -b mybranchname_temp
git merge --squash mybranchname
git commit -am "Message describing all squashed commits"
git branch -m mybranchname mybranchname_unsquashed
git branch -m mybranchname
@kachayev
kachayev / css-parser.md
Last active November 12, 2022 04:20
Parsing CSS file with monadic parser in Clojure
@kornysietsma
kornysietsma / wait-until.clj
Created October 24, 2014 11:41
wait until in clojure test
(def default-wait-death (time/seconds 5))
(def default-wait-delay-ms 10)
(defn wait-until*
"wait until a function has become true"
([name fn] (wait-until* name fn default-wait-death))
([name fn wait-death]
(let [die (time/plus (time/now) wait-death)]
(loop []
(if-let [result (fn)]
@wayspurrchen
wayspurrchen / git patterns.md
Last active January 18, 2023 21:38
Useful Git Techniques

History

Show file at certain commit

git show <hash>:<file>

Show history of a file

git log -p <filename>

@reborg
reborg / rich-already-answered-that.md
Last active July 11, 2024 09:54
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@ganapativs
ganapativs / iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup.md
Last active July 16, 2024 14:36
iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup
@EddiG
EddiG / wireshark.md
Last active March 31, 2024 10:34
How to decrypt SSL/TLS traffic in Wireshark on MacOS

The main point is to save the SSL/TLS keys those used by the web browser (SSLKEYLOGFILE=/tmp/tmp-google/.ssl-key.log).
In the example below we run brand new instance of Google Chrome (--user-data-dir=/tmp/tmp-google do the trick):
SSLKEYLOGFILE=/tmp/tmp-google/.ssl-key.log /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/tmp-google
Then run the Wireshark and open the Preferences -> Protocols -> SSL, where we put the path to the SSL keys log file into the (Pre)-Master-Secret log filename field.
Now all SSL/TLS traffic from this browser instance will be decrypted.