Skip to content

Instantly share code, notes, and snippets.

View niittymaa's full-sized avatar

niittymaa niittymaa

View GitHub Profile
@hur1can3
hur1can3 / 2012oecd.csv
Last active December 11, 2015 05:18
a parallel coordinate gits
Country % GDP per capita Physicians Nurses Total hospital beds Discharges ALOS Life expectancy Infant Mortality Tobacco Alcohol Obesity
Australia 9.1 3670.2 3.08 10.06 3.73 15549.1 5.1 81.8 4.1 15.1 10.3 21.3
Austria 11 4394.8 4.78 7.67 7.63 26099.8 6.6 80.7 3.9 23.2 12.2 12.4
Belgium 10.5 3968.8 2.92 15.06 6.44 17840.7 8.1 80.3 3.5 20.5 10.8 13.8
Canada 11.4 4444.9 2.37 9.34 3.19 8260.4 7.7 80.8 5.1 16.3 8.2 17.5
Chile 8 1202.2 1.43 1.51 2.04 9936 5.6 79 7.9 29.8 8.6 12.1
Czech Republic 7.5 1883.5 3.58 8.06 7.01 19163 7.1 77.7 2.7 24.6 11.4 17.4
Denmark 11.1 4463.9 3.48 15.44 3.5 17153.7 4.6 79.3 3.4 20 10.3 13.4
Estonia 6.3 1293.8 3.24 6.13 5.33 16933.6 7 75.6 3.3 26.2 11.4 16.9
Finland 8.9 3250.9 3.27 9.58 5.85 18159.2 11.6 80.2 2.3 19 9.7 15.6
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active October 31, 2025 16:45
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@lavoiesl
lavoiesl / paths.php
Last active December 8, 2017 10:12
PHP Document Root, Path and URL detection.
<?php
$base_dir = __DIR__; // Absolute path to your installation, ex: /var/www/mywebsite
$doc_root = preg_replace("!${_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www
$base_url = preg_replace("!^${doc_root}!", '', $base_dir); # ex: '' or '/mywebsite'
$protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https';
$port = $_SERVER['SERVER_PORT'];
$disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : ":$port";
$domain = $_SERVER['SERVER_NAME'];
$full_url = "${protocol}://${domain}${disp_port}${base_url}"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc.
@felipesabino
felipesabino / ColorConverter.js
Created March 1, 2013 17:38
Javascript color conversion RGB, CMYK and HSV source from http://www.webtoolkit.info/javascript-color-conversion.html
/**
*
* Javascript color conversion
* http://www.webtoolkit.info/javascript-color-conversion.html
*
**/
function HSV(h, s, v) {
if (h <= 0) { h = 0; }
if (s <= 0) { s = 0; }
@deespater
deespater / gist:5395192
Last active February 13, 2023 00:31
Alphabets in different European languages
<?php
$l = range('a', 'z');
$alphabets = array(
'en' => $l,
'fr' => array_merge($l, array('é', 'à', 'è', 'ù', 'â', 'ê', 'î', 'ô', 'û', 'ç', 'ë', 'ï', 'ü', 'ÿ', 'æ', 'œ')),
'de' => array_merge($l, array('ä', 'ö', 'ü', 'ß')),
'es' => array_merge($l, array('ñ', 'ü', 'ch', 'll')),
'it' => array_merge($l, array('à', 'è', 'é', 'ì', 'í', 'î', 'ò', 'ó', 'ù', 'ú')),
'pt' => array_merge($l, array('á', 'â', 'ã', 'à', 'ç', 'é', 'ê', 'í', 'ó', 'ô', 'õ', 'ú', 'ü')),
'el' => array('α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ', 'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω'),
@uhunkler
uhunkler / SketchLayers.jstalk
Last active September 12, 2016 02:59
SketchLayers - JSTalk Sketch
/**
* SketchLayers - a collection of layer related functions
*
* @type {object}
*/
var SketchLayers =
{
collection : [],
selection : function()
@michaelchaize
michaelchaize / LayerPNG24.jsx
Created May 31, 2013 14:59
This is the JavaScript code used to control Photoshop. It exports the selected layer to a transparent PNG file.
#target photoshop
// EXPORT PNG 24 TRANSPARENT
// Function to launch the "Layer > Rasterize > with style"
// Produced with the JavaScript listener
function raterizeLayerStyle(){
var idrasterizeLayer = stringIDToTypeID( "rasterizeLayer" );
var desc5 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
@zeffii
zeffii / hexify.py
Last active April 26, 2016 12:38 — forked from anonymous/hexify.py
# python's hex function
import struct
def hex_to_rgb(rgb_str):
int_tuple = struct.unpack('BBB', bytes.fromhex(rgb_str))
return tuple([val/255 for val in int_tuple])
print(hex_to_rgb('f8ff35'))
import bpy
class RENDER_OT_test(bpy.types.Operator):
bl_idname = 'render.oha_test'
bl_label = 'Test'
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
self.report({'DEBUG', 'INFO'}, 'Printing report to Info window.')
return {'FINISHED'}
@skw
skw / the_future_of_rustboy.md
Last active September 16, 2018 07:28
The Future of Rustboy - For archival purposes.

Transcribed for archival purposes.

Excerpts from "The Future of Rustboy"

an interview with Brian Taylor - by Steve Ogden - Nov 2011

OGDEN:

Did Rustboy fall victim to Hollywood’s notorious “Development Hell”, or to “One-Man Show Fatigue Syndrome”? (Or a combination?)