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 | |
# server settings | |
SERVER="[email protected]" | |
SERVER_PATH="/var/www/project" | |
SSH_PORT="2222" | |
# sync with some standard exclude paths | |
rsync -rav -e "ssh -p $SSH_PORT" \ | |
--exclude='*.git' \ |
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 | |
HOST="" | |
USER="" | |
PASS="" | |
LCD="./" | |
RCD="/path/to/remote/" | |
lftp -e "mirror --reverse \ | |
--delete \ | |
--verbose \ |
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
// check if el is in view | |
function is_el_in_view(el, full_el_visible) { | |
if (!el) return false; | |
// should we return true if the element is only partially visible (default) | |
full_el_visible = typeof full_el_visible != "undefined" ? full_el_visible : false; | |
var el_pos = get_absolute_offset(el), | |
el_h = el.offsetHeight, | |
window_h = window.innerHeight || document.documentElement.clientHeight, |
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
// show the html5 input type range values | |
function show_ranges() { | |
// selector and classname on the range value | |
var selector = "input[type=range]", | |
class_name = "range-value"; | |
// get the range values with jquery | |
var ranges = $(selector); | |
// check for support for the html5 range input and then show the value from the range |
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
mogrify -format jpg -quality 80 *.png |
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
// use one mixin for styling placeholder input text cross browser | |
@mixin placeholder ($color) { | |
/* WebKit browsers */ | |
::-webkit-input-placeholder { | |
color: $color; | |
} | |
/* Mozilla Firefox 4 to 18 */ | |
input:-moz-placeholder, | |
textarea:-moz-placeholder { | |
color: $color; |
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 to make event for both "click" and "touchend" depending on if its a touch device or not | |
*/ | |
(function($){ | |
$.fn.touchClick = function(callback) { | |
var eventType = is_touch_device() ? "touchend" : "click"; | |
this.each(function() { | |
$(this).bind(eventType, callback); | |
if (eventType == "touchend") { | |
$(this).click(function(e) {e.preventDefault();}); |
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 is_touch_device() { | |
return !!('ontouchstart' in window); | |
} |
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 | |
output_file='all.min.js' | |
tmp_file='tmp.js' | |
cat my_js_1.js my_js_2.js > $tmp_file | |
curl -d compilation_level=SIMPLE_OPTIMIZATIONS -d output_format=text -d output_info=compiled_code --data-urlencode "js_code@${tmp_file}" http://closure-compiler.appspot.com/compile > $output_file | |
rm $tmp_file |
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 strip-unit($num) { | |
@return $num / ($num * 0 + 1); | |
} | |
@mixin rem($size: 1.6) { | |
font-size: ($size * 10) + px; | |
font-size: (($size * 10) / strip-unit($base_font_size)) + rem; | |
} |
OlderNewer