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
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev | |
git clone https://github.com/joyent/node.git | |
cd node | |
# 'git tag' shows all available versions: select the latest stable. | |
git checkout enter-a-version | |
# Configure seems not to find libssl by default so we give it an explicit pointer. | |
# Optionally: you can isolate node by adding --prefix=/opt/node |
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
# Start up the script with forever | |
forever start /path/to/script.js -l /var/log/activity-log.log -o /var/log/activity-log.log -e /var/log/error-log.log -a --watch | |
# Using --watch will reload the server if the contents of the js file changes thereby allowing on-the-fly deployments | |
# -l is for logging forever output, -o is for program output, -e is for program error logs | |
# -a will append the logs |
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
/** | |
* Temporary GLOBAL Facebook fix for appended slash. | |
* - Keep in mind that this can have side-effects if you have any data where you ACTUALLY use / at the end. | |
* - Place this at the beginning of your code, preferably in a file that all of your apps include. | |
**/ | |
foreach($_REQUEST as $key=>$val) $_REQUEST[$key] = rtrim($val, '/'); | |
foreach($_GET as $key=>$val) $_GET[$key] = rtrim($val, '/'); | |
foreach($_POST as $key=>$val) $_POST[$key] = rtrim($val, '/'); | |
/** |
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
/** POLYFILL FOR IE PLACEHOLDER **/ | |
$(document).ready(function(){ | |
if(!('placeholder' in document.createElement('input'))){ | |
$('input[placeholder]').each(function(){ | |
if(this.value == ''){ | |
var $el = $(this); | |
$el.bind('click', function(ev){ $(ev.target).unbind('click'); ev.target.value = ''; }); | |
$el.val($el.attr('placeholder')); | |
} | |
}); |
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
netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80 | |
@echo ========= SQL Server Ports =================== | |
@echo Enabling SQLServer default instance port 1433 | |
netsh advfirewall firewall add rule name="SQL Server" dir=in action=allow protocol=TCP localport=1433 | |
@echo Enabling Dedicated Admin Connection port 1434 | |
netsh advfirewall firewall add rule name="SQL Admin Connection" dir=in action=allow protocol=TCP localport=1434 | |
@echo Enabling Conventional SQL Server Service Broker port 4022 | |
netsh advfirewall firewall add rule name="SQL Service Broker" dir=in action=allow protocol=TCP localport=4022 | |
@echo Enabling Transact SQL/RPC port 135 |
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
<script> | |
function notify() { | |
var havePermission = window.webkitNotifications.checkPermission(); | |
if (havePermission == 0) { | |
// 0 is PERMISSION_ALLOWED | |
var notification = window.webkitNotifications.createNotification( | |
'http://i.stack.imgur.com/dmHl0.png', | |
'Chrome notification!', | |
'Here is the notification text' | |
); |
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
<div class="select"> | |
<select name=""> | |
<option value=""> </option> | |
<option value="1">Option 1</option> | |
<option value="2">Option 2</option> | |
</select> | |
</div> | |
<script> | |
// select element styling |
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
<!-- Datepicker js --> | |
<script src="{{baseurl}}/system/site/js/bootstrap/3.0/plugins/datepicker/bootstrap-datepicker.js"></script> | |
<link rel="stylesheet" href="{{baseurl}}system/css/bootstrap/3.0/plugins/datepicker/bootstrap-datepicker.css"/> | |
{% if zaj.lang != 'en' %} | |
<script src="{{baseurl}}/system/site/js/bootstrap/3.0/plugins/datepicker/locales/bootstrap-datepicker.{{zaj.lang}}.js"></script> | |
{% endif %} | |
<!-- Timepicker js --> | |
<script src="{{baseurl}}system/js/bootstrap/3.0/plugins/timepicker/bootstrap-timepicker.js"></script> | |
<link rel="stylesheet" type="text/css" href="{{baseurl}}system/css/bootstrap/3.0/plugins/timepicker/bootstrap-timepicker.css"> |
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
<rewrite> | |
<rules> | |
<rule name="HTTP to HTTPS redirect" stopProcessing="true"> | |
<match url="(.*)" /> | |
<conditions> | |
<add input="{HTTPS}" pattern="off" ignoreCase="true" /> | |
</conditions> | |
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /> | |
</rule> | |
</rules> |
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 backgroundCover = function(){ | |
var wh = $(window).height(); | |
var ww = $(window).width(); | |
var wa = ww / wh; | |
$('div.carousel div.element.article img').each(function(){ | |
var $this = $(this); | |
var ar = $this.attr('width') / $this.attr('height'); | |
if(wa < ar) $this.css({'height': wh, 'width': 'auto', 'position': 'fixed'}); | |
else $this.css({'height': 'auto', 'width': ww, 'position': 'fixed'}); | |
}); |
OlderNewer