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 | |
if [ "`whoami`" != 'root' ]; then | |
echo '' | |
echo 'Only root can execute this script' | |
echo '' | |
exit 1 | |
fi |
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 | |
add=`svn status |\ | |
grep ? |\ | |
grep '\.[a-z]\{2,4\}$' |\ | |
grep -v '\.sql$' |\ | |
grep -v '\.sh$' |\ | |
grep -v '\.gz' |\ | |
grep -v '\.tar' |\ | |
grep -v '\.swp' |\ |
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 | |
del=`svn status | grep ! | grep -v localhost | awk -F' ' '{print $2}'` | |
if [ "$del" != '' ]; then | |
svn del $del | |
fi |
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
<?php | |
function folderSize ($dir) | |
{ | |
$size = 0; | |
foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) { | |
$size += is_file($each) ? filesize($each) : folderSize($each); | |
} |
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
;(function ($, window, document, undefined) { | |
var pluginName = 'name', defaults = {}; | |
function Plugin (element, options) { | |
this.element = element; | |
this.settings = $.extend({}, defaults, options); | |
this.init(); | |
} |
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
<?php | |
function fixHtml ($html) | |
{ | |
libxml_use_internal_errors(true); | |
$DOM = new \DOMDocument; | |
$DOM->recover = true; | |
$DOM->preserveWhiteSpace = false; | |
$DOM->substituteEntities = false; | |
$DOM->loadHtml('<?xml encoding="UTF-8">'.$html, LIBXML_NOBLANKS | LIBXML_ERR_NONE); |
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/bash | |
echo '' | |
case "$1" in | |
'bootstrap') | |
alias="$1" | |
url='https://github.com/twbs/bootstrap/trunk/dist' | |
;; | |
'fontawesome'|'font-awesome') |
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/bash | |
echo '' | |
XVFB=`which Xvfb` | |
if [ "$XVFB" == '' ]; then | |
echo 'Xvfb is not installed' | |
echo '' | |
exit 1; |
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/bash | |
# Put this file into a folder with PNG pictures with transparent background | |
# ----- Default values ----- # | |
ext='.png' # Original pictures have this extension | |
prefix='frame-' # Final pictures name with this prefix | |
background='white' # Final pictures background color | |
padding=100 # Do not fit to max width/height, leave some padding |
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
<?php | |
$urls = array( | |
'http://google.com/', | |
'https://google.com/', | |
'https://google.com?q=Google', | |
'https://google.com/search?q=Google', | |
'https://google.com/search/?q=Google&limit=10', | |
'https://google.com/search/?q=Google#results', | |
); |
OlderNewer