Skip to content

Instantly share code, notes, and snippets.

View mertyildiran's full-sized avatar
:octocat:
Doing some octopus work

M. Mert Yildiran mertyildiran

:octocat:
Doing some octopus work
View GitHub Profile
@mertyildiran
mertyildiran / setup-script.sh
Last active April 8, 2019 00:30
Ubuntu 18.04 / KDE neon 5.14.3 clean setup
#!/bin/bash
sudo apt update
sudo apt -y install build-essential cmake
# Install Nvidia driver
sudo apt -y install nvidia-384
# Install git
sudo apt -y install git
@mertyildiran
mertyildiran / startup-script.sh
Last active April 6, 2019 00:32
Ubuntu 18.04 / KDE neon 5.14.3 mouse and screen tearing fix
#!/bin/bash
# chmod a+x startup-script.sh
# chmod 777 startup-script.sh
# sudo cp ./startup-script.sh /etc/init.d/
# sudo ln -s /etc/init.d/startup-script.sh /etc/rc5.d/
# --- Microsoft Classic Intellimouse ---
# Fix mouse sensitivity
xinput --set-prop 8 282 2.0
import theano
import theano.tensor as T
import numpy as np
import cPickle
import random
import matplotlib.pyplot as plt
class RNN(object):
def __init__(self, nin, n_hidden, nout):
@mertyildiran
mertyildiran / gtk-gif.c
Last active July 2, 2017 17:10
Run animated GIF with black background using Gtk
#include <gtk/gtk.h>
#include <gdk/gdkscreen.h>
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <unistd.h>
#include <stdlib.h>
/*
* This program shows you how to create semi-transparent windows,
@mertyildiran
mertyildiran / alphademo-gdk-pixbuf.c
Last active March 20, 2023 06:47
Display an animated GIF using GdkPixbufAnimation in a transparent window (GTK+)
#include <gtk/gtk.h>
#include <gdk/gdkscreen.h>
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <stdlib.h>
/*
* This program shows you how to create semi-transparent windows,
* without any of the historical screenshot hacks. It requires
* a modern system, with a compositing manager. I use xcompmgr
@mertyildiran
mertyildiran / alphademo-png.c
Created July 2, 2017 14:29
Transparent window with GTK and display a PNG image
#include <gtk/gtk.h>
#include <gdk/gdkscreen.h>
#include <cairo.h>
/*
* This program shows you how to create semi-transparent windows,
* without any of the historical screenshot hacks. It requires
* a modern system, with a compositing manager. I use xcompmgr
* and the nvidia drivers with RenderAccel, and it works well.
*
@mertyildiran
mertyildiran / alphademo.c
Created July 2, 2017 13:10
Transparent window with GTK
#include <gtk/gtk.h>
#include <gdk/gdkscreen.h>
#include <cairo.h>
/*
* This program shows you how to create semi-transparent windows,
* without any of the historical screenshot hacks. It requires
* a modern system, with a compositing manager. I use xcompmgr
* and the nvidia drivers with RenderAccel, and it works well.
*
@mertyildiran
mertyildiran / cairo-xshape-example.c
Created July 1, 2017 21:31
Transparent drawing using Xlib and Cairo
/* compile with:
* gcc $(pkg-config xext x11 cairo-xlib-xrender --cflags --libs) cairo-xshape-example.c
* https://github.com/jordansissel/experiments/blob/master/randomcode/cairo-xshape-example.c
*/
#include <cairo-xlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
#include <X11/extensions/shape.h>
@mertyildiran
mertyildiran / Makefile
Created June 29, 2017 13:28
transregion: X11 SHAPE extension input region demo
# Makefile for transregion
CFLAGS = -g
LDFLAGS = -L/usr/X11R6/lib -lXpm -lXext -lX11 -lm
all: transregion
transregion: transregion.o
$(CC) -o transregion transregion.o $(LDFLAGS)
@mertyildiran
mertyildiran / answer.py
Created June 21, 2017 01:22
Q&A Engine
import nltk
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')
import wikipedia
page = wikipedia.page(wikipedia.search('albert einstein')[0])
sentences = nltk.sent_tokenize(page.content)
print nltk.word_tokenize(sentences[0])
print nltk.pos_tag(sentences[0])