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 | |
/** | |
* This function will handle all of our file uploading | |
*/ | |
function uploadFile(){ | |
if(isset($_POST['upload_button'])){ | |
$file = $_FILES['file_upload']; //This is our file variable | |
$name1 = $file['name']; | |
$ran = rand(0, 9999); | |
function findexts ($filename) |
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 | |
/** | |
* This function will handle all of our file uploading | |
*/ | |
function uploadFile(){ | |
if(isset($_POST['upload_button'])){ | |
$file = $_FILES['file_upload']; //This is our file variable | |
$name1 = $file['name']; | |
$ran = rand(0, 9999); | |
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 format_result($result) { | |
if($result['type'] == 0) {pane($result);} /*else if($result['type'] == 1) { ticker($result); }*/ else { die(); } | |
} | |
function rename_name($name) { | |
return str_replace(' ', '', $name); | |
} | |
function pane($result) { | |
if($result['title']) {$title = ': '.$result['title'];} | |
$name = rename_name($result[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
/* basic text and background properties */ | |
/* ------------------------------------------------------------------------------------------ */ | |
body { | |
-webkit-user-select: none; | |
word-wrap: break-word; | |
margin:0; | |
padding: 0; | |
border: 0; | |
widows: 100%; | |
overflow-x: hidden; |
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
fixDate = (wrongDate) -> | |
date = new Date(wrongDate) | |
date.setMinutes date.getMinutes() + new Date().getTimezoneOffset() | |
return date |
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
collect = (args...,callback) -> | |
ret = {} | |
len = args.length | |
for i in [0...len] | |
for own k,v of args[i] | |
ret[k] = v | |
callback(ret) | |
### | |
In normal JS |
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
fun1 = -> | |
fun2 true, (err, resp) -> | |
if !err | |
doStuff() | |
else | |
console.log "Error: #{err}" | |
res.end JSON.stringify err | |
fun2 = (val, callback) -> | |
if val |
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
sudo apt-get update | |
sudo apt-get install python-software-properties python g++ make | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install nodejs |
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 app, cluster, cpu, cpus, express, http, path, setup; | |
cluster = require('cluster'); | |
if (cluster.isMaster) { | |
if (process.env.NODE_ENV === 'setup') { | |
console.log('Starting setup process.'); | |
express = require('express'); |
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
sudo service apache2 stop | |
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common | |
sudo apt-get autoremove --purge | |
sudo rm -Rf "$(whereis apache2)" | |
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
sudo apt-get install nginx nodejs npm g++ -y | |
ln -s /usr/bin/nodejs /usr/bin/node | |
npm install forever -g | |
sudo apt-get update -y |
OlderNewer