Skip to content

Instantly share code, notes, and snippets.

View benzap's full-sized avatar
🏠
Working from home

Benjamin Zaporzan benzap

🏠
Working from home
View GitHub Profile
@benzap
benzap / transparency.el
Created March 15, 2015 18:58
Emacs: Transparency Function that works in windows
(defun set-transparency (alpha-level)
(interactive "p")
(message (format "Alpha level passed in: %s" alpha-level))
(let ((alpha-level (if (< alpha-level 2)
(read-number "Opacity percentage: " 85)
alpha-level))
(myalpha (frame-parameter nil 'alpha)))
(set-frame-parameter nil 'alpha alpha-level))
(message (format "Alpha level is %d" (frame-parameter nil 'alpha))))
@benzap
benzap / git-rebase-with-master
Created June 19, 2015 14:25
Useful shell commands for dealing with git
#!/bin/bash
#allows you to perform a rebase on your current branch with the master
#branch
#turn off the proxy
#. unsetproxy
CURRENT_BRANCH="`git rev-parse --abbrev-ref HEAD`"
@benzap
benzap / array2.cljs
Created September 5, 2015 12:55
Simpler 2d Array manipulation in clojurescript for 2d games
(ns array2
"Simple and helpful functions for manipulating 2d arrays. This is a set
of functions for manipulating a mutable js/Array instance, and
treats it like a 2d array. This is useful for the domain of 2d games.
Examples:
(def array1 (aa 1 2))
(def array2 (aa 3 4))
@benzap
benzap / event.clj
Created September 5, 2015 13:05
Simple keyboard event tracking code in use for 2d games
(ns event
"Macros for event.cljs")
(defmacro on-keydown [key & body]
`(set-on-keydown ~key (fn [] ~@body)))
(defmacro on-keyup [key & body]
`(set-on-keyup ~key (fn [] ~@body)))
@benzap
benzap / .tmux.conf
Created June 7, 2012 17:47
Tmux configuration file
# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window
# change window splitting to emacs style
unbind %
unbind 3
@benzap
benzap / disableImplicit.mk
Created June 9, 2012 20:41
Template Makefile For library Construction
# Disable implicit rules to speedup build
.SUFFIXES:
SUFFIXES :=
%.out:
%.a:
%.ln:
%.o:
%: %.o
%.c:
%: %.c
@benzap
benzap / Baseserver.py
Created June 20, 2012 14:11
Thread Pool Example (Jon's)
import socket, select
import os, sys, signal
import hashlib, hmac
import logging
import profile
from BaseHandler import *
class BaseServer:
def __init__(self, host, port, HandlerClass = BaseHandler):
@benzap
benzap / GitPresentation.org
Created June 24, 2012 17:38
Introduction to Version Control and Git Crash Course

Introduction

What is version control?

Version control is the management of changes to documents, computer programs, and general collections of information. I will refer to it as a project.

How to use version control?

Version control is a means in which several people can work on one project. It also allows you to review changes that people have made in the past.

@benzap
benzap / README.md
Created August 17, 2013 04:38 — forked from nickbudi/README.md

budi's CS:GO Config

This is my constantly updated CS:GO autoexec config.

Put the file autoexec.cfg in ...\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg or take what you want from it and add to your autoexec config!

Launch Options

-novid -noborder -high -threads 4 -freq 144 +exec autoexec.cfg +mat_vignette_enable 0
(require 'iimage)
(autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
(autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)
(add-to-list 'iimage-mode-image-regex-alist '("@startuml\s+\\(.+\\)" . 1))
;; Rendering plantuml
(defun plantuml-render-buffer ()
(interactive)
(message "PLANTUML Start rendering")
(shell-command (concat "java -jar ~/Downloads/plantuml.jar "