Skip to content

Instantly share code, notes, and snippets.

View stamat's full-sized avatar
💥

Nikola Stamatović stamat

💥
View GitHub Profile
anonymous
anonymous / shapedwindow.py
Created February 9, 2017 18:58
#!/usr/bin/env python
# A simple demonstration of using cairo to shape windows.
# Natan 'whatah' Zohar
import gtk
import math
class ShapedGUI:
def __init__(self):
self.window = gtk.Window()
self.window.show() # We show here so the window gets a border on it by the WM
@michaelvdnest
michaelvdnest / optparse_demo.rb
Last active November 15, 2023 21:37
A sample of Ruby optparse usage
require 'optparse'
options = {}
class Parser
def self.parse(args)
options = {}
opt_parser = OptionParser.new do |opts|
opts.banner = 'Usage: demo.rb [options] ARG...'
opts.separator 'A demo of optparse.'
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
@jmcveigh
jmcveigh / film-simulation.txt
Created May 2, 2016 00:04
Film Simulation for Digital Photography
http://imagemagick.org/script/binary-releases.php - Image Magick command-line photo tool
http://rawtherapee.com/ - Open Source and Free Software Lightroom (ADVANCED)
http://bit.ly/1rLv4Gc - General Software Contracting licensed HaldCLUT 3D Colour maps
"convert <in-file.jpg> <3D-colour-map.png> -hald-clut <out-file.jpg>" - command to run a successfully installed Image Magick convert for film-simulation in digital photography
Regards,
Jason McVeigh
@schmidt1024
schmidt1024 / svg.js
Created June 3, 2015 13:59
Replace all SVG images with inline SVG using jQuery
/*
* Replace all SVG images with inline SVG
*/
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@muraoka-edo
muraoka-edo / webrick_tmpl.rb
Created September 29, 2014 06:03
[Ruby] Webrick(ERB)
#!/usr/bin/env ruby
# coding: utf-8
require 'webrick'
config = {
:Port => 10080,
:DocumentRoot => '.',
}
@mjackson
mjackson / color-conversion-algorithms.js
Last active April 14, 2024 08:46
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@jensgro
jensgro / Outliner.js
Created April 23, 2012 12:57 — forked from arieh/Outliner.js
Cross-Lib accessible outline removal
/*!
Copyright (c) <2012> <Arieh Glazer>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE