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
##### Recommended CodeIgniter Code ##### | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
#Removes access to the system folder by users. | |
#Additionally this will allow you to create a System.php controller, | |
#previously this would not have been possible. | |
#'system' can be replaced if you have renamed your system folder. | |
RewriteCond %{REQUEST_URI} ^system.* |
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
Number::formatMoney = (decimalPlaces, decimalChar, thousandsChar) -> | |
n = this | |
c = decimalPlaces | |
d = decimalChar | |
t = thousandsChar | |
c = (if isNaN(c = Math.abs(c)) then 2 else c) | |
d = (if d is undefined then "." else d) | |
t = (if t is undefined then "," else t) | |
s = (if n < 0 then "-" else "") | |
i = parseInt(n = Math.abs(+n or 0).toFixed(c)) + "" |
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
[ | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol", "extend": false} }, | |
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol", "extend": false} }, | |
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend" : true} }, | |
{ "keys": ["shift+left"], "command": "move_to", "args": {"to": "bol", "extend": true} }, | |
{ "keys": ["shift+right"], "command": "move_to", "args": {"to": "eol", "extend": true} }, | |
{ "keys": ["alt+left"], "command": "move_to", "args": {"to": "bol", "extend": false} }, | |
{ "keys": ["alt+right"], "command": "move_to", "args": {"to": "eol", "extend": false} } | |
] |
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
$(function () { | |
if (window.devicePixelRatio == 2) { | |
var images = $("img.hires"); | |
// loop through the images and make them hi-res | |
for(var i = 0; i < images.length; i++) { | |
// create new image name |
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
// destroy image modal | |
$('.modal').on('hidden', function () { | |
$(this).data('modal', null); | |
}); | |
//latest bootstrap | |
$(document).ready(function() { | |
$('#myModal').on('hidden.bs.modal', function (e) { | |
$(this).removeData('bs.modal'); |
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
The good news is that, we have nave, a Virtual Environments for Node, to help us. | |
https://github.com/isaacs/nave | |
Installing nodejs is dead easy now. | |
$ wget https://raw.github.com/isaacs/nave/master/nave.sh | |
$ chmod +x nave.sh | |
$ ./nave.sh install 0.8.8 | |
$ ./nave.sh use 0.8.8 |
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 | |
$fileName = 'somefile.csv'; | |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); | |
header('Content-Description: File Transfer'); | |
header("Content-type: text/csv"); | |
header("Content-Disposition: attachment; filename={$fileName}"); | |
header("Expires: 0"); | |
header("Pragma: public"); |
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
app.use(function(req, res, next) { | |
var oneof = false; | |
if(req.headers.origin) { | |
res.header('Access-Control-Allow-Origin', req.headers.origin); | |
oneof = true; | |
} | |
if(req.headers['access-control-request-method']) { | |
res.header('Access-Control-Allow-Methods', req.headers['access-control-request-method']); | |
oneof = true; | |
} |