Skip to content

Instantly share code, notes, and snippets.

Johannes Berdin johannesberdin

Block or report user

Report or block johannesberdin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pre-commit
#!/bin/sh
LIST=$(git diff --name-only --diff-filter=AM HEAD)
for file in $LIST
do
if [ "$file" == '#' ]; then
continue
fi
EXTENSION=$(echo "$file" | grep ".spp$")
View color-blind-simulation.js
var blinder = require('color-blind');
var colorBlindWatch = $('.color-blind-watch');
var colorBlindResult = $('.color-blind-result-watch');
var randomColor = '#000000';
window.setInterval(function(){
randomColor = '#'+ ('000000' + Math.floor(Math.random()*16777215).toString(16)).slice(-6);
colorBlindFn(randomColor);
}, 1000);
View random-color.js
var color '#'+ ('000000' + Math.floor(Math.random()*16777215).toString(16)).slice(-6);
View souyuz.rb
module Fastlane
module Actions
class SouyuzAction < Action
def self.run(params)
require 'souyuz'
absolute_app_path = File.expand_path(Souyuz::Manager.new.work(params))
if absolute_app_path.include?(".ipa")
Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = absolute_app_path
ENV[SharedValues::IPA_OUTPUT_PATH.to_s] = absolute_app_path
View test.sh
#!/bin/sh
# Arguments
MYSQL_PASSWORD=${1}
SERVER_NAME=${2}
SERVER_ALIAS=${3}
SERVER_ADMIN=${4}
MAIL_ADDRESS=${5}
MAIL_DOMAIN=${6}
MAIL_REPLY_PREFIX=${7}
@johannesberdin
johannesberdin / Vagrantfile
Created Jan 4, 2016
Default Vagrantfile for my Vagrant lamp stack
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.ssh.forward_agent = true
config.vm.network :private_network, ip: "10.0.0.10"
@johannesberdin
johannesberdin / vagrant.sh
Last active Jan 4, 2016
Provision shell script for my Vagrant lamp stack
View vagrant.sh
#!/bin/sh
# vagrant shell script for simple lamp stack
export DEBIAN_FRONTEND=noninteractive
# update
apt-get -qq update
echo "Updated system."
# php55 repository
apt-get -qq -y install python-software-properties
@johannesberdin
johannesberdin / php.ini
Created Jan 3, 2016
Default PHP.ini for my Vagrant lamp stack
View php.ini
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@johannesberdin
johannesberdin / 000-default.conf
Created Jan 3, 2016
Default Apache2 configuration for my Vagrant lamp stack
View 000-default.conf
<VirtualHost *:80>
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
@johannesberdin
johannesberdin / lowercase.sql
Last active Aug 29, 2015
Generates ALTER TABLE queries for lowercased column names and table names
View lowercase.sql
/* Lowercases column names */
SELECT 'ALTER TABLE ' || quote_ident(c.table_schema) || '.' || quote_ident(c.table_name) || ' RENAME ' || quote_ident(c.column_name) || ' TO ' || quote_ident(lower(c.column_name)) || ';' As ddlsql FROM information_schema.columns As c WHERE c.table_schema NOT IN('information_schema', 'pg_catalog') AND c.column_name <> lower(c.column_name) ORDER BY c.table_schema, c.table_name, c.column_name;
/* Lowercases table names */
SELECT 'ALTER TABLE ' || quote_ident(c.table_schema) || '.' || quote_ident(c.table_name) || ' RENAME TO ' || quote_ident(lower(c.table_name)) || ';' As ddlsql FROM information_schema.tables As c WHERE c.table_schema NOT IN('information_schema', 'pg_catalog') AND c.table_name <> lower(c.table_name) ORDER BY c.table_schema, c.table_name;
You can’t perform that action at this time.