This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# | |
# This script automates images optimization | |
# is mainly used by a developer who manually | |
# can execute it when adding new images to the | |
# project | |
# | |
# Download and compile following binaries: | |
# | |
# - [jpegtran](http://www.ijg.org/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env sh | |
# This script accepts 2 mandatory arguments: | |
# COMMAND and ENVIRONMENT | |
# | |
# It's run by git repo hook and current | |
# workign directory is the bare repo path | |
# | |
# Global variables accessible: | |
# $WORKTREE (points to the working tree) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env sh | |
# This script accepts 1 mandatory argument: | |
# COMMAND | |
# | |
# It's run by git repo hook and current | |
# workign directory is the bare repo path | |
# | |
# Global variables accessible: | |
# $WORKTREE (points to the working tree) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This patch changes the way Candle's UP state is detected | |
// Instead of comparing it to the previous candle, we just compare CLOSE and OPEN | |
// values here | |
(function(HC) { | |
var seriesTypes = HC.seriesTypes; | |
seriesTypes.candlestick.prototype.getAttribs = function () { | |
seriesTypes.column.prototype.getAttribs.apply(this, arguments); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env sh | |
### | |
### awk_vs_grep.sh - Profiles 2 methods used to sort file contents using custom pattern | |
### make sure to have file "awk_vs_grep.txt" with some content | |
### for more details refer to this Question: http://unix.stackexchange.com/questions/75498/sort-using-custom-pattern/ | |
### | |
### Usage: `./awk_vs_grep.sh` - will execute commands 10 times and only print profile results | |
### Usage: `./awk_vs_grep.sh 1000` - will execute commands 1000 times and only print profile results | |
### Usage: `./awk_vs_grep.sh 1000 /dev/tty` - will execute commands 1000 times and print commands output + results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ServicesController < ApplicationController before_filter :authenticate_user!, :except => [:create] def index # get all authentication services assigned to the current user @services = current_user.services.all end def destroy # remove an authentication service linked to the current user @service = current_user.services.find(params[:id]) @service.destroy redirect_to services_path end def create # get the service parameter from the Rails router params[:service] ? service_route = params[:service] : service_route = 'no service (invalid callback)' # get the full hash from omniauth omniauth = request.env['omniauth.auth'] # continue only if hash and parameter exist if omniauth and params[:service] # map the returned hashes to our variables first - the hashes differ for every service if service_route == 'facebook' omniauth['extra']['user_hash']['email'] ? email = omniauth['extra']['user_hash']['email'] : email = '' omniauth['extra']['user_hash']['name'] ? name = omniaut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Section "ServerLayout" | |
Identifier "X.org Configured" | |
Screen 0 "Screen0" 0 0 | |
InputDevice "Mouse0" "CorePointer" | |
InputDevice "Keyboard0" "CoreKeyboard" | |
EndSection | |
Section "Files" | |
ModulePath "/usr/local/lib/xorg/modules" | |
FontPath "/usr/local/lib/X11/fonts/misc/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include GENERIC | |
# Exclude CPU types | |
nocpu I486_CPU | |
nocpu I586_CPU | |
ident WORKSTATION | |
# Disable mount partitions from UNIX server over TCP/IP | |
# Enable when needed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
unless ARGV[0] | |
puts 'Usage: newdraft "the draft title"' | |
exit(-1) | |
end | |
date_prefix = Time.now.strftime("%Y-%m-%d") | |
post_name = ARGV.join ' ' | |
post_file_name = post_name.strip.downcase.gsub(/ /, '-') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# <oldrev> <newrev> <refname> | |
# sanitize pushed branch | |
while read oldrev newrev ref | |
do | |
branch=$(echo $ref | awk -F'/' '{print $3}') | |
if [ "$branch" != "master" -a "$branch" != "docs" ] | |
then | |
echo It is not allowed to push any branch except for master and docs |