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
package main
import (
"log"
"math/rand"
"time"
"github.com/miekg/dns"
)
view = new QWebView(this);
QPalette palette = view->palette();
palette.setBrush(QPalette::Base, Qt::transparent);
view->page()->setPalette(palette);
view->setAttribute(Qt::WA_OpaquePaintEvent, false);
$ osascript
tell application "VLC"
activate
end tell
#include <iostream>
// opencv
#include <highgui.h>
#include <cv.h>
const char* cascade_path = "/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml";
CvHaarClassifierCascade* cascade = (CvHaarClassifierCascade*)cvLoad(cascade_path, 0, 0, 0 );
//CvHaarClassifierCascade* cascade = cvLoadHaarClassifierCascade(cascade_path, cvSize(1,1));
CvMemStorage* storage = cvCreateMemStorage( 0 );
tell application "iChat"
repeat with theChat in chats
repeat with theBuddy in buddies
set buddy_id to id of theBuddy
send buddy_id to theChat
end repeat
end repeat
end tell
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <error.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <linux/if_tun.h>
#include <net/if.h>
all: get
get: get.ml
ocamlfind ocamlopt -package json-wheel -linkpkg get.ml -o get
clean:
rm get.cm[xi] get.o get
(* 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;
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
@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;
}