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
<?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 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
## 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 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 | |
if [[ '' == $1 || '' == $2 ]]; then | |
echo "Provide domain name and URL" | |
exit 1 | |
fi | |
wget \ | |
--recursive \ | |
--no-clobber \ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="UTF-8"> | |
<title>Drawing Tools</title> | |
<script type="text/javascript" | |
src="http://maps.google.com/maps/api/js?sensor=false&libraries=drawing"></script> | |
<style type="text/css"> | |
#map, html, body { |
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
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 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
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 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
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 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
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 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script> | |
var db; | |
// https://developer.mozilla.org/en/IndexedDB/Using_IndexedDB | |
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB; |
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
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
COLOR_NONE="\[\e[0m\]" |
OlderNewer