Skip to content

Instantly share code, notes, and snippets.

View baris's full-sized avatar
💭
I may be slow to respond.

Baris Metin baris

💭
I may be slow to respond.
View GitHub Profile
site '*://mail.google.com/*' {
unmap ?
unmap j
unmap k
unmap n
unmap p
unmap x
unmap e
unmap r
unmap c
package main
import (
"log"
"math/rand"
"time"
"github.com/miekg/dns"
)

Keybase proof

I hereby claim:

  • I am baris on github.
  • I am barismetin (https://keybase.io/barismetin) on keybase.
  • I have a public key whose fingerprint is A9BD 3454 E5C5 3C1B 73B3 38E5 0BE2 EA81 27E1 9432

To claim this, I am signing this object:

@baris
baris / gtk.css
Created December 23, 2013 04:42
.config/gtk-3.0/gtk.css
@define-color bg-grey #333;
@define-color active-grey #000;
@define-color border-grey #555;
TerminalWindow .notebook {
border: 0;
padding: 0;
color: #eee;
background-color: shade(@active-grey, 1);
@baris
baris / gist:7494873
Created November 16, 2013 01:55
scala compress, pack test functions
object TestProgram {
def compress1[T](lst: Seq[T]) = {
lst.foldRight(Seq[T]()) {
(n: T, compressed: Seq[T]) => if (compressed.headOption == Option(n)) compressed else n +: compressed
}
}
def compress2[T](lst: Seq[T]): Seq[T] = lst match {
case first :: second :: rest if (first == second) => compress2(second +: rest)
@baris
baris / kwin_two_panes.js
Last active December 15, 2015 05:48
KWin script to automatically move and resize windows to fit left or right half of the screen when switching windows.
var to_the_left = true;
previous_active_client_id = null;
function resize_client(client) {
geo = client.geometry;
geo.width = workspace.workspaceWidth / 2;
geo.height = workspace.workspaceHeight - 30;
client.geometry = geo;
}
@baris
baris / irssi_notify.pl
Created January 8, 2013 06:31
irssi notify.pl using notify-send (instead of dbus-send) on ubuntu.
##
## Put me in ~/.irssi/scripts, and then execute the following in irssi:
##
## /load perl
## /script load notify
##
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
let string_strip_dir s lst ~right =
let rec strip s lst' =
match lst' with
[] -> s
| hd::tail ->
let len = String.length s in
let index = if right then (len - 1) else 0 in
if (String.get s index) = hd then
let cropped = if right then String.sub s 0 index else String.sub s 1 (len-1) in
(* ocamlopt -I +glMLite GL.cmxa Glut.cmxa testgl.ml *)
open GL;;
open Glu;;
open Glut;;
let start_show () =
glClear [GL_COLOR_BUFFER_BIT];
glBegin GL_TRIANGLES;
all: get
get: get.ml
ocamlfind ocamlopt -package json-wheel -linkpkg get.ml -o get
clean:
rm get.cm[xi] get.o get