This file contains hidden or 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/bash | |
orientation=$1 | |
if [ "$orientation" != "next" ] \ | |
&& [ "$orientation" != "previous" ]; | |
then | |
orientation="next" | |
fi |
This file contains hidden or 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
!** Display Options | |
Xcursor.theme: Adwaita | |
!Xft.dpi: 92 | |
Xft.autohint: 0 | |
Xft.lcdfilter: lcddefault | |
Xft.hintstyle: hintslight | |
Xft.hinting: 1 | |
Xft.antialias: 1 | |
Xft.rgba: rgb |
This file contains hidden or 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
{ | |
"countries": { | |
"country": [ | |
{ | |
"countryCode": "AD", | |
"countryName": "Andorra", | |
"capital": "Andorra la Vella", | |
"languages": "ca" | |
}, | |
{ |
This file contains hidden or 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
" avoid close vim when delete buffer | |
function! <SID>BufcloseCloseIt() | |
let l:currentBufNum = bufnr("%") | |
let l:alternateBufNum = bufnr("#") | |
if buflisted(l:alternateBufNum) | |
buffer # | |
else | |
bnext |
This file contains hidden or 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 php | |
<?php | |
const MOD = 1e9 + 7; | |
function fact($n) { | |
return ($n > 1) ? $n * fact($n - 1) : 1; | |
} | |
function mpow($base, $exp, $mod) { |
This file contains hidden or 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
/** http://stackoverflow.com/questions/12652234/sql-query-to-remove-special-characters **/ | |
DROP FUNCTION IF EXISTS `stripSpecialChars`; | |
DELIMITER ;; | |
CREATE FUNCTION `stripSpeciaChars`(`dirty_string` varchar(2048),allow_space TINYINT,allow_number TINYINT,allow_alphabets TINYINT,no_trim TINYINT) RETURNS varchar(2048) CHARSET utf8 DETERMINISTIC | |
BEGIN | |
/** | |
* MySQL function to remove Special characters, Non-ASCII,hidden characters leads to spaces, accents etc | |
* Downloaded from http://DevZone.co.in | |
* @param VARCHAR dirty_string : dirty string as input |
This file contains hidden or 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
# PS1 | |
PROMPT_COMMAND='PWD_ABBREVIATION=$(p="${PWD#${HOME}}"; [ "${PWD}" != "${p}" ] && printf "~";IFS=/; for q in ${p:1}; do printf /${q:0:1}; done; printf "${q:1}")' | |
export PS1='`if [ $? = 0 ];then echo "\[\033[1;32m\]✔";else echo "\[\033[1;31m\]✘";fi` \[\033[1;34m\]\u\[\033[0m\]@\[\033[1;30m\]\h\[\033[0;33m\] ${PWD_ABBREVIATION}\[\033[0;35m\]$(__git_ps1) \[\033[1;31m\]>\[\033[0m\] ' | |
# PS1 | |
export PS1='`if [ $? = 0 ];then echo "\[\033[1;32m\]✔";else echo "\[\033[1;31m\]✘";fi` \[\033[1;30m\]\u \[\033[1;34m\]\w\[\033[0;35m\]$(__git_ps1) \[\033[1;31m\]>\[\033[0m\] ' |
This file contains hidden or 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 | |
tags=() | |
while read line; do | |
tags+=($line); | |
done <<< "$(git tag | sort -V | tail -n2)"; | |
tag1=${1:-${tags[0]}} | |
tag2=${2:-${tags[1]}} |
This file contains hidden or 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 node | |
"use strict"; | |
String.PAD_LEFT = 1; | |
String.PAD_RIGHT = 2; | |
String.PAD_BOTH = 3; | |
String.prototype.pad = function(len, pad, dir) { | |
var str = this; | |
if (typeof(len) == "undefined") { len = 0; } | |
if (typeof(pad) == "undefined") { pad = ' '; } |