Skip to content

Instantly share code, notes, and snippets.

View gasi's full-sized avatar

Daniel Gasienica gasi

View GitHub Profile
@gasi
gasi / setup.sh
Created June 1, 2013 20:04
Setting up an SSH server on @dotcloud docker CentOS image
# Install OpenSSH server and SSH client
yum install -y openssh-server
yum install -y openssh-clients
# Install passwd
yum install -y passwd
# Set root password
passwd
# TODO: Enter new root password
@gasi
gasi / keybase.md
Created April 9, 2014 21:38
keybase.md

Keybase proof

I hereby claim:

  • I am gasi on github.
  • I am gasi (https://keybase.io/gasi) on keybase.
  • I have a public key whose fingerprint is 7BF9 745C 13E2 588A 7ACB 4524 20D2 7861 FE0A 06B2

To claim this, I am signing this object:

@gasi
gasi / compile.sh
Last active August 29, 2015 14:02
Stylus: Silent error on non-existent hash key
stylus --print ./hash.styl
@gasi
gasi / index._coffee
Last active August 29, 2015 14:03
Express Streamline #11 Bug
express = require 'express-streamline'
app = express()
# Throw sync error
fail = -> throw new Error 'FAIL!'
app.get '/good', (req, res, _) ->
fail() # Throw sync error without async function call
<!DOCTYPE html>
<html>
<head>
<title>Image Pyramid Demo</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no">
<script src="pyramiddemo.js"></script>
<style>
body {
<!DOCTYPE html>
<html>
<head>
<title>Image Pyramid Demo</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no">
<script src="pyramiddemo.js"></script>
<style>
body {
Verifying that +gasi is my openname (Bitcoin username). https://onename.io/gasi
@gasi
gasi / composite.c
Created April 30, 2015 05:07
VIPS alpha compositing
/* compile with:
*
* gcc -g -Wall composite.c `pkg-config vips --cflags --libs`
*/
#include <stdio.h>
#include <vips/vips.h>
/* Composite images `src` and `dst`.
*/
@gasi
gasi / alpha-resizing-1024x768-paper.png
Last active August 29, 2015 14:20
`vips_affine` using non-`nearest` interpolation causes dark fringing around bright edges in transparent images
alpha-resizing-1024x768-paper.png
@gasi
gasi / resize-alpha.c
Created May 6, 2015 23:11
Resize images with alpha channel, e.g. PNG, using VIPS without dark fringing using premultiplication of the alpha channel
/*
* Compile with:
*
* gcc -g -Wall resize-alpha.c `pkg-config vips --cflags --libs` -o resize-alpha
*
* Run with:
*
* ./resize-alpha in out interpolation
*
* Examples: