Skip to content

Instantly share code, notes, and snippets.

View pgaertig's full-sized avatar

Piotr Gaertig pgaertig

View GitHub Profile
@rodleviton
rodleviton / imagemagick-install-steps
Created May 26, 2014 07:37
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
@guanidene
guanidene / autoconfigure_display
Created April 28, 2014 13:58
Automatically configure display to detect and use external monitor, if connected.
#!/bin/bash
# Author: Pushpak Dagade
# This script automatically detects if an external monitor is connected,
# and if so, expands my screen with the monitor on the left and my
# laptop screen on the right. If my laptop lid is shut & an external
# monitor is connected, this script uses only the external monitor as
# the display.
#
@allgress
allgress / reagent_datascript.cljs
Last active February 16, 2023 21:16
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@niklasvincent
niklasvincent / build-nginx.sh
Last active October 11, 2019 04:44
Build script for statically compiled nginx 1.4.7 with OpenSSL 1.0.1e.
#!/bin/bash
set -e
NGINX_VERSION="1.6.0"
NGINX_TARBALL="nginx-${NGINX_VERSION}.tar.gz"
PCRE_VERSION="8.34"
PCRE_TARBALL="pcre-${PCRE_VERSION}.tar.gz"
OPENSSL_VERSION="1.0.1g"
OPENSSL_TARBALL="openssl-${OPENSSL_VERSION}.tar.gz"
@ptaoussanis
ptaoussanis / reagent-component.cljs
Created February 3, 2014 10:49
Reagent component util
(defn component
"Experimental! A Reagent 'component' is a (fn [& [props children this]]) that:
* May have special metadata for React lifecycle methods.
* Returns either Hiccup data, or a nested (usu. post-setup) component[1].
This util makes writing Reagent components a little more convenient:
(component
:render (fn [node_ & cmpt-args]) -> Hiccup data, or nested component[1].
;; Additional methods optional:
:did-mount (fn [node])
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

ClientGetter playClientGetter = new ClientGetter() {
private int playPort;
private String playHost;
{
String portString = System.getenv("PLAY_PORT");
if (portString == null)
portString = "9000";
playPort = Integer.parseInt(portString);
playHost = System.getenv("PLAY_HOST");
@ismell
ismell / README.md
Last active September 10, 2016 15:39
Docker Ubuntu upstart scripts

Production Ready Process Monitoring

  1. Install docker-manger.conf and docker-instance.conf in /etc/init

  2. Create a containers file in /etc/docker/ with the following format

     name: image cmd
    

    The name must be unique.

  3. sudo service docker-manager start

@lukas-vlcek
lukas-vlcek / gist:5846745
Last active October 10, 2018 06:54
Ukázka ICU Folding. Předpokládá Elasticsearch 0.90.0 a nainstalovaný ICU plugin 1.9.0
#!/bin/sh
curl -X DELETE 'localhost:9200/i/'
curl -X POST 'localhost:9200/i/' -d '{
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"analysis" : {
"analyzer" : {
@freshtonic
freshtonic / description.md
Last active December 17, 2015 10:39
The Rails Asset Pipeline & Angular JS partials.

My Angular.js partials live in public/partials.

In development mode I want them served from there, in production I want to have an Angular.js module called templates which simply popuates the template cache for me.

This isn't just about performance in production: it's making sure the partials are embedded in the assets which forces the partial's lifetime to be the same as the assets with no other caching worries when we redeploy the app.