Skip to content

Instantly share code, notes, and snippets.

@killercup
killercup / README.md
Created March 16, 2012 11:03
Unicorn, RVM Wrapper, Init.d

You have your Rails Apps with specific Gemsets in RVM.

The following commands creates a wrapped unicorn_rails bin. Be sure to replace the variables and that you have unicorn in your bundle.

rvmsudo rvm wrapper [RUBY VERSION]@[GEMSET] [GEMSET] unicorn_rails

Now you have a /usr/local/rvm/bin/[GEMSET]_unicorn_rails I will refer to [GEMSET]_unicorn_rails as [WRAPPED_NAME]

@killercup
killercup / index.html
Created June 21, 2020 12:52
Some post layout scribbles
<article>
<header>
<h1>Aliquid voluptas facilis odio</h1>
<p class="abstract">Look at this glorious layout. Beautiful side&shy;bars on wide screens: One for navi&shy;gat&shy;ing between and inside of articles; and one that render side&shy;notes (that become foot&shy;notes on narrow screens), as well as auto&shy;matically shows side&shy;notes for links (showing their titles). And let's not forget the brilliant typo&shy;graphy.</p>
<p class="meta">Written by <a href="#">Pascal Hertleif</a> on June&nbsp;20, 2020. Published in <a href="#">Typography</a>, <a href="#">Webshit</a>, and <a href="#">Code</a>.</p>
<!--<nav class="series">
<a href="#" class="pre">
<span class="label">Previous post</span>
<span class="title">Lorem ipsum secundus</span>
</a>
@killercup
killercup / Readme.md
Created February 7, 2014 18:34
Image Processing Server: Resizer and Optimizer

Image Resizer and Optimizer

Idea: grunt-contrib-imagemin as a Service

Tech Stack

  • nginx
  • luajit
  • imagemagick
  • OptiPNG, pngquant, jpegtran and gifsicle
@killercup
killercup / min-max.rs
Created September 30, 2015 12:02 — forked from anonymous/playground.rs
Rust min! and max! macros
macro_rules! max {
($x:expr) => ( $x );
($x:expr, $($xs:expr),+) => {
{
use std::cmp::max;
max($x, max!( $($xs),+ ))
}
};
}
stages:
- test
- postprocess
rust builder:
stage: test
image: docker:stable
variables:
CONTAINER_NAME: registry.gitlab.com/PASTE_IN_PROJECT_PATH_HERE/builder:$CI_COMMIT_REF_SLUG
before_script:
@killercup
killercup / newsyslog.conf
Last active September 30, 2019 03:21
FreeBSD logrotate via /etc/newsyslog.conf
/var/log/nginx-access.log 644 7 1024 * JC /var/run/nginx.pid 30
/var/log/nginx-error.log 644 7 1024 * JC /var/run/nginx.pid 30
/home/app/episodefever/shared/log/unicorn.stdout.log app:app 666 7 1024 * JC
/home/app/episodefever/shared/log/unicorn.stderr.log app:app 666 7 1024 * JC
/home/app/episodefever/shared/log/newrelic_agent.log app:app 666 7 1024 * JC
/home/app/episodefever/shared/log/production.log app:app 666 7 1024 * JC /usr/home/app/episodefever/shared/pids/unicorn.pid 30
/home/app/episodefever/shared/log/resque-pool.stdout.log app:app 666 7 1024 * JC /usr/home/app/episodefever/shared/pids/resque-pool.pid 30
/home/app/episodefever/shared/log/resque-pool.stderr.log 666 7 1024 * JC /usr/home/app/episodefever/shared/pids/resque-scheduler.pid 30
@killercup
killercup / docker-compose.yml
Last active October 25, 2018 12:02
Rust in docker
version: "3.2"
services:
rust:
image: rust:1.29.2 # alternatively choose one from https://hub.docker.com/u/japaric/
volumes:
- type: bind
source: './'
target: /app/code
read_only: true
- type: volume
@killercup
killercup / fixit.fish
Last active September 16, 2018 08:03
Fish function to restart a bunch of macOS services that tend to break
function fixit --description 'restart a bunch of macOS services that tend to break'
sudo killall -KILL appleeventsd
sudo killall VDCAssistant
sudo killall AppleCameraAssistant
sudo killall -HUP mDNSResponder
killall Dock
killall Spotlight
end

Ideas for versioned serde struct

Goals

  • version external APIs
    • read (write?) data of older versions
  • be agnostic over protocol (but we'll actually use JSON in our examples)

First draft