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 | |
PRJ='project' | |
DROPBOX_DIR='/home/atma/Dropbox/backups' | |
PROJECT_DIR='/home/atma/www/project' | |
MHOST='localhost' | |
MUSER='root' | |
MPASS='pass' | |
MBASE='project' |
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 | |
# System + MySQL backup script | |
# Full backup day - Sun (rest of the day do incremental backup) | |
# --------------------------------------------------------------------- | |
### System Setup ### | |
DIRS="/home/www1 /home/www2" | |
BACKUP=/tmp/backup.$$ | |
NOW=$(date +"%d-%m-%Y") | |
INCFILE="/root/tar-inc-backup.dat" | |
DAY=$(date +"%a") |
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 | |
/** | |
* @param int The number of items | |
* @param array Three item forms as for 1, 2-4(22,33), 5(66,78) respectively | |
*/ | |
function plural_form($n, $forms) | |
{ | |
$n = abs($n) % 100; | |
$n1 = $n % 10; | |
if ($n > 10 AND $n < 20) return $forms[2]; |
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
mencoder -endpos 01:00:00 -ovc copy -oac copy movie.avi -o first_half.avi | |
mencoder -ss 01:00:00 -oac copy -ovc copy movie.avi -o second_half.avi |
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 | |
/** | |
* Convert a phrase to a SEO friendly uri (slug). | |
* | |
* @param string $title Phrase to convert | |
* @param string $separator Word separator | |
* @param boolean $ascii_only Transliterate to ASCII? | |
* @return string | |
*/ | |
function make_slug($title, $separator = '-', $ascii_only = true) { |
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 parseUri (str) { | |
var o = parseUri.options, | |
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), | |
uri = {}, | |
i = 14; | |
while (i--) uri[o.key[i]] = m[i] || ""; | |
uri[o.q.name] = {}; | |
uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) { |
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
$("img").one('load', function() { | |
// do stuff | |
}).each(function() { | |
if(this.complete) $(this).load(); | |
}); |
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
@reboot ~/node-app-starter.sh >> cron.log 2>&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
/** | |
* jquery.plugin.js v1.0.0 | |
* http://github.com/someone/someplugin | |
*/ | |
;( function( $, window, undefined ) { | |
'use strict'; | |
var pluginName = 'pluginName', | |
Plugin = function( options, element ) { | |
this.$el = $( element ); |
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
<!doctype html> | |
<html lang="en-US"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Default Page Title</title> | |
<link rel="shortcut icon" href="favicon.ico"> | |
<link rel="icon" href="favicon.ico"> | |
<link rel="stylesheet" type="text/css" href="styles.css"> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<!--[if lt IE 9]> |
OlderNewer