Skip to content

Instantly share code, notes, and snippets.

@prasincs
prasincs / zkhack2024_IV_puzzleF1_writeup.md
Last active February 7, 2024 04:36 — forked from niooss-ledger/zkhack2024_IV_puzzleF1_writeup.md
Write-up for ZK Hack IV puzzle F1: Gamma Ray
@prasincs
prasincs / gorilla_auth.go
Created March 20, 2017 00:17 — forked from jbuchbinder/gorilla_auth.go
Gorilla mux + basic authentication from htpasswd file
package main
import (
auth "github.com/abbot/go-http-auth"
"github.com/gorilla/mux"
"log"
"net/http"
"time"
)
@prasincs
prasincs / cluster_lines.py
Created March 18, 2017 08:30 — forked from amix/cluster_lines.py
Groups (clusters) similar lines together from a text file using k-means clustering algorithm.
"""
Groups (clusters) similar lines together from a text file
using k-means clustering algorithm.
Also does some simple cleaning (such as removing white space and replacing numbers with (N)).
Example:
python cluster_lines.py --clusters 20 invalid_dates.txt
@prasincs
prasincs / service-checklist.md
Created September 12, 2016 07:12 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@prasincs
prasincs / gist:8f5a0561eb3d27c1ddea
Created October 29, 2015 22:04 — forked from zolrath/gist:2305333
tmux status line from wemux example.

For a tmux status line as seen in the example image for the wemux project: wemux

The session on the left in the example screen shot uses a patched font from the vim-powerline project. Inconsolata-dz, you beautiful creature.

To duplicate the left status line add the following lines to your ~/tmux.conf

set -g status-left-length 32
set -g status-right-length 150
#Newbie programmer
# Exp: -> first exercise in recursion
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
@prasincs
prasincs / .bashrc
Created February 15, 2011 09:51 — forked from tjl2/.bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
@prasincs
prasincs / x.js
Created July 26, 2009 19:21 — forked from tssm0n/x.js
CmdUtils.CreateCommand({
names: ["java"],
arguments: [{role: "object",
nountype: noun_arb_text,
label: "search criteria"}],
icon: "http://www.sun.com/favicon.ico",
preview: "Searches The Java 6 API.",
help: "Enter the name of the Java class or package for which you would like to see the documentation.",
author: {name: "KS", email: "tss@cornbread.com"},