Skip to content

Instantly share code, notes, and snippets.

View ashwani-rathee's full-sized avatar
☀️
day

Ashwani Rathee ashwani-rathee

☀️
day
View GitHub Profile
using Gtk
win = GtkWindow("Skyring", 300, 350)
set_gtk_property!(win,:resizable,false)
grid = GtkGrid()
set_gtk_property!(grid,:margin,20)
text = ""
@richard-to
richard-to / x11_screen_grab.cpp
Created April 7, 2014 10:30
X11 Example code for grabbing screenshots of window and sending key events
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <X11/Xlib.h>
@svschannak
svschannak / rgb-cmyk-rgb-conversion
Created February 4, 2014 10:10
convert rgb to cmyk to rgb
def rgb_to_cmyk(r,g,b):
cmyk_scale = 100
if (r == 0) and (g == 0) and (b == 0):
# black
return 0, 0, 0, cmyk_scale
# rgb [0,255] -> cmy [0,1]
c = 1 - r / 255.