###SSH into a remote machine###
ssh user@mydomain.com
#or by ip address
ssh user@192.168.1.1
exit: exit
###Install Something###
#If it's a new server, update apt-get first thing
###SSH into a remote machine###
ssh user@mydomain.com
#or by ip address
ssh user@192.168.1.1
exit: exit
###Install Something###
#If it's a new server, update apt-get first thing
module.exports = { | |
/** | |
* | |
* Using raw socket.io functionality from a Sails.js controller | |
* | |
*/ | |
index: function (req,res) { |
// Note that instance and class methods could also be defined at the adapter level | |
// (e.g. CRUD adapters add .save() and .destroy() methods, but the Twillio API might add a .call() method) | |
// User.js | |
module.exports = sails.Model.extend({ | |
// Adapters are applied from left to right | |
// (methods defined in more than one adapter use the rightmost adapter's version, just like _.extend) | |
adapter: ['mysql', 'twilio'], | |
# laravel new-app | |
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git" | |
alias artisan="php artisan" | |
alias migrate="php artisan migrate" | |
alias serve="php artisan serve" | |
alias dump="php artisan dump" | |
alias t="phpunit" | |
# Generators Package |
var express = require('express'); | |
var aws = require('aws-sdk'); | |
var config = require('./config.js'); | |
aws.config.update({accessKeyId: config.key, secretAccessKey: config.secret}); | |
aws.config.update({region: 'us-east-1'}); | |
var app = express(); | |
app.configure(function(){ |
<?php | |
// Got bored/bugged of seeing the watermarks/Link at the bottom of 9GAG images. So wrote this script to remove them | |
// Eg. http://d24w6bsrhbeh9d.cloudfront.net/photo/4216213_700b_v1.jpg | |
// Very very basic PHP, but gets stuff done! | |
// Coded while listening to: http://8tracks.com/jkurtis/we-ll-run-wild :D | |
// USAGE: Put all pics in a 'pics' folder and create an empty 'crop' folder. Run Script. Enjoy. :D | |
$count=0; | |
echo "<h6>STARTED</h6>"; | |
foreach(glob('pics/{*.jpg,*.jpeg,*.png}', GLOB_BRACE) as $image) | |
{ |
<?php | |
function indexed($url) { | |
$url = 'http://webcache.googleusercontent.com/search?q=cache:' . urlencode($url); | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); | |
curl_setopt($ch, CURLOPT_NOBODY, true); | |
curl_setopt($ch, CURLOPT_USERAGENT, 'Chrome 10'); | |
scriptencoding utf-8 | |
let s:calendar_list = [ | |
\ ['Australian Holidays', 'en.australian#holiday@group.v.calendar.google.com'], | |
\ ['Austrian Holidays', 'en.austrian#holiday@group.v.calendar.google.com'], | |
\ ['Brazilian Holidays', 'en.brazilian#holiday@group.v.calendar.google.com'], | |
\ ['Canadian Holidays', 'en.canadian#holiday@group.v.calendar.google.com'], | |
\ ['China Holidays', 'en.china#holiday@group.v.calendar.google.com'], | |
\ ['Christian Holidays', 'en.christian#holiday@group.v.calendar.google.com'], | |
\ ['Danish Holidays', 'en.danish#holiday@group.v.calendar.google.com'], |
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |