Skip to content

Instantly share code, notes, and snippets.

var elixir = require('laravel-elixir');
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var minify = require('gulp-minify-css');
var _ = require('underscore');
/*
|--------------------------------------------------------------------------
| Uglify Task
|--------------------------------------------------------------------------
#! /bin/bash
echo "\n\n------------\n\nSetting locale to en_US..."
#sudo echo 'LANG="en_US.UTF-8"
#LC_MESSAGES="C"
#LC_ALL="en_US.UTF-8"' >> /etc/environment
echo 'LANG="en_US.UTF-8"
LC_MESSAGES="C"
@libern
libern / iterm2-solarized.md
Created July 5, 2016 04:28 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OS X / macOS)

Solarized

@libern
libern / README.md
Created July 5, 2016 04:43 — forked from agnoster/README.md
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@libern
libern / gist:2bd3351a53e41e2589d31e8178c5c6be
Created January 18, 2017 03:55 — forked from belsrc/gist:672b75d1f89a9a5c192c
Simple Vue.js filters that I usually need
/**
* Changes value to past tense.
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc.
* http://jsfiddle.net/bryan_k/0xczme2r/
*
* @param {String} value The value string.
*/
Vue.filter('past-tense', function(value) {
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing
var vowels = ['a', 'e', 'i', 'o', 'u'];
@libern
libern / nginx.conf
Created May 19, 2017 10:21 — forked from morhekil/nginx.conf
Full request/response body logging in nginx
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
}
server {
@libern
libern / gist:0568e935b0b5e1d4bfb44c5cd4826b02
Created July 6, 2017 09:53 — forked from jameshartig/gist:2357002
Get MP3 bit rate and sample rate in PHP
//returns an assoc array with bitRate (kbps) and sampleRate (hz)
function getMP3BitRateSampleRate($filename)
{
if (!file_exists($filename)) {
return false;
}
$bitRates = array(
array(0,0,0,0,0),
array(32,32,32,32,8),
@libern
libern / Auto-layout-keyboard-adjustment.md
Created September 14, 2017 00:02 — forked from dlo/Auto-layout-keyboard-adjustment.md
How to adjust a view's height with Auto Layout when a keyboard appears or disappears in iOS 7.

This gist outlines how to resize a view when a keyboard appears using Auto Layout (there are a bunch of code samples out there that manually adjust the view's frame, but that's just so 2013). The method I outline below works universally on both iPhone and iPad, portrait and landscape, and is pretty darn simple.

Setting Up

The first thing to do is to define our containing view controller, the view, and the bottom constraint that we'll use to adjust its size.

Here's HeightAdjustingViewController.h. We don't need to expose any public properties, so it's pretty bare.

@libern
libern / flush-dns.sh
Created November 27, 2017 08:50 — forked from craigvantonder/flush-dns.sh
Flushing the DNS in Ubuntu 16.04
#!/bin/bash
# run this command to flush dns cache:
sudo /etc/init.d/dns-clean restart
# or use:
sudo /etc/init.d/networking force-reload
# Flush nscd dns cache:
sudo /etc/init.d/nscd restart
# If you wanted to refresh your settings you could disable and then run
sudo service network-manager restart