Skip to content

Instantly share code, notes, and snippets.

http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@svileng
svileng / pinterestify.rb
Created February 12, 2014 18:43
Adds pinterest buttons on markup containing images
# Takes some markup (html or markdown) and wraps img elements into
# a div with a pinterest share link before image
# Params:
# markup - html or markdown that contains the images
# url - url for the shared item on pinterest
# desc - description for shared item on pinterest
# markdown - (optional) true if markup needs to be parsed as markdown (default), otherwise false
# wrap_class - (optional) css class for the img wrapper (default: pin-wrapper)
# pin_text - (optional) text for the pinterest link (default: Pin to Pinterest)
def pinterestify(markup, url, desc, options = {})
# Gemfile
gem "puma"
# Procfile
web: bundle exec puma -p $PORT -e $RACK_ENV -C config/puma.rb
# add to config block config/environments/production.rb
config.threadsafe!
# get rid of NewRelic after_fork code, if you were doing this:
@svileng
svileng / gulpfile.js
Created February 25, 2014 23:13
Combining two sources in a single Gulp task
var gulp = require('gulp');
var es = require('event-stream');
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var gutil = require('gulp-util');
var paths = {
coffeeSrc: 'assets/coffee/**/*.coffee',
coffeeDest: 'assets/js',
@svileng
svileng / gulpfile.js
Last active August 29, 2015 14:09 — forked from rudijs/gulpfile.js
var gulp = require('gulp'),
watch = require('gulp-watch'),
// This will keeps pipes working after error event
plumber = require('gulp-plumber'),
// linting
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
@svileng
svileng / index.html
Last active August 29, 2015 14:26 — forked from karolk/index.html
mini spa
<!doctype html>
<script>
function $(selector) {
return document.querySelectorAll(selector)
}
function onClick(selector, callback) {
$("html")[0].addEventListener("click", function(event) {
@svileng
svileng / compile
Last active November 24, 2016 03:17
Elixir LDN Examples
info "Building Phoenix static assets"
npm run build
mix phoenix.digest
@svileng
svileng / data.ex
Created April 25, 2017 12:27
data.ex
deals = [
%{id: 1, amount: 1000, closed_at: ~N[2016-11-01 08:10:00]},
%{id: 2, amount: 1000, closed_at: ~N[2016-11-01 12:20:00]},
%{id: 3, amount: 1000, closed_at: ~N[2016-11-01 23:30:00]},
%{id: 4, amount: 1000, closed_at: ~N[2016-11-02 04:40:00]},
%{id: 5, amount: 1000, closed_at: ~N[2016-11-03 15:50:00]},
%{id: 6, amount: 1000, closed_at: ~N[2016-11-04 18:51:00]},
%{id: 7, amount: 1000, closed_at: ~N[2016-11-04 10:02:00]},
%{id: 8, amount: 1000, closed_at: ~N[2016-11-05 11:14:00]},
%{id: 9, amount: 1000, closed_at: ~N[2016-11-06 01:43:00]},
@svileng
svileng / keybase.md
Created June 12, 2020 14:53
Keybase

Keybase proof

I hereby claim:

  • I am svileng on github.
  • I am svileng (https://keybase.io/svileng) on keybase.
  • I have a public key ASB6p8Qzs5oIJs0-Jh5dSTElcntsSfTC5abC1E32DegVqAo

To claim this, I am signing this object: