Loïc Kreitmann loickreitmann

View AWS_EC2_Node_Nginx.md

Amazon Linux AMI with Node/NPM and Nginx

Installation

1. Create a Amazon Linux AMI instance on AWS/EC2

2. Connect to your instance with SSH

3. Update your instance:

View iphoto-find-mov-copy-renamed.rb
1 2 3 4 5 6 7 8 9 10
# was writen and run on system with Ruby 1.8.7
require 'find'
require 'fileutils'
src_dir = '/path/to/iPhoto Library/Masters'
out_dir = '/path/wher/you/want/to/save/you/ruby-copy/'
count = 0
new_count = 0
 
Find.find(src_dir) do |path|
if not FileTest.directory?(path)
View jQuery.cookie.js
1 2 3 4 5 6 7 8 9 10
View String.times.js
1 2 3
String.prototype.times = function( n ) {
return Array.prototype.join.call( { length : n + 1 }, this );
};
View twitter_feed.html
1 2 3 4 5 6 7 8 9 10
<!DOCTYPE html>
<html>
<head>
<title>Twitter feed consumption example</title>
<style>
.main {
margin: 0 auto;
position: relative;
width: 328px;
height: 302px;
View web-server-user.php
1
<?php echo(exec("whoami")); ?>
View String.stripTags.js
1 2 3 4 5 6 7
/**
* stripTags: removes HTML tags from a string
* @return String
*/
String.prototype.stripTags = function () {
return this.replace(/<[^<>]+>/g, ' ').replace(/\s{2,}/g, ' ');
};
View String.toUnderscored.js
1 2 3 4 5 6 7 8 9 10
/**
* toUnderscored: converts string to underscored
*/
String.prototype.toUnderscored = function () {
return this.replace(/^\s+|\s+$/g, "")
.toLowerCase()
.replace(/_/g, '')
.replace(/(\s[a-z0-9])/g, function ($1) {
return $1.replace(/\s/, '_');
})
View String.toDashed.js
1 2 3 4 5 6 7 8 9 10
/**
* toDashed: converts string to dashed
*/
String.prototype.toDashed = function () {
return this.replace(/^\s+|\s+$/g, "")
.toLowerCase()
.replace(/-/g, '')
.replace(/(\s[a-z0-9])/g, function ($1) {
return $1.replace(/\s/, '-');
})
View String.trim.js
1 2 3 4 5 6
/**
* trim: removes leading and trailing white space
*/
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g, "");
};
Something went wrong with that request. Please try again.