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
# count lines in directory | |
find . -type f ! -path "\.git" ! -path "./CMakeFiles/*" | xargs wc -l | |
# du of hidden directories | |
du -hs .[^.]* | |
du -s .[^.]* | sort -nr | |
# mirror apache listing | |
wget --execute="robots = off" --mirror --convert-links --no-parent -R index.html [http://example.com/path/to/dir] | |
find -name "index.html*" -exec rm {} \; |
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
{ | |
"name": "Socket", | |
"description": "Simple Socket.io server for chat-like communication.", | |
"version": "0.1.0", | |
"main": "server.js", | |
"dependencies": { | |
"socket.io": "~0.9.16" | |
} | |
} |
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 | |
define('BASE_PATH', '/home/rgalka/Pictures'); | |
$image = @$_GET['image']; | |
if (!empty($image)) { | |
$file = BASE_PATH . '/' . $image; | |
if (!is_file($file)) { | |
echo "Sorry, no file matching request"; | |
exit; | |
} |
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 arrayConditionToString(array $def, array &$parts = array(), $operator = 'AND') | |
{ | |
foreach ($def as $k => $v) { | |
if (is_string($v) && 0 === strpos($v, ':')) { | |
$parts[] = ' (' . $v . ') '; | |
} |
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
## LFTP | |
lftp -c "set ftp:list-options -a; | |
open ftp://${FTP_USER}:${FTP_PASSWD}@${FTP_HOST}; | |
lcd ${SOURCE_PATH}; | |
cd ${DEST_PATH}; | |
mirror --reverse \ | |
--delete \ | |
--verbose \ | |
--ignore-time \ |
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 | |
if [[ '' == $1 || '' == $2 ]]; then | |
echo "Provide domain name and URL" | |
exit 1 | |
fi | |
wget \ | |
--recursive \ | |
--no-clobber \ |
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.ajax = function(opts) { | |
var xhr = new XMLHttpRequest({mozSystem: true}); | |
var method = opts.type || 'GET'; | |
method = method.toUpperCase(); | |
if ('POST' !== method && opts.data) { | |
opts.url += '?' + jQuery.param(opts.data); | |
} | |
xhr.open(method.toUpperCase(), opts.url); | |
xhr.responseType = opts.dataType || 'json'; | |
xhr.onreadystatechange = function () { |
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
document.querySelector('body').classList.add('tizen'); | |
if (!window.indexedDB) { | |
window.indexedDB = window.webkitIndexedDB; | |
} | |
if (!window.MutationObserver) { | |
window.MutationObserver = window.WebKitMutationObserver; | |
} | |
document.addEventListener('tizenhwkey', function(e) { |
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
var data = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." ; | |
var blob = new Blob([data], { | |
type : "text/plain" | |
//type : "text/plain; charset=x-user-defined" | |
//type : "text/plain; charset=utf8" | |
}); | |
blobToBase64(blob, function(b64) { // convert BLOB to BASE64 | |
var newBlob = base64ToBlob(b64) ; // convert BASE64 to BLOB | |
$('body').html(blob.size + " != " + newBlob.size) ; |
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
web-build ./ -e "node_modules*" -e "nbproject*" -e ".git*" -e "Gruntfile.js" -e "package.json" -e "/.*" --output .build ./ | |
cd .build/ | |
web-signing -p r.galka | |
web-packaging -o -n ../shabetteconcier.wgt ./ | |
web-install -w widget.wgt |
OlderNewer