sudo yum update
##Install Redis https://gist.github.com/dstroot/2776679
wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
chmod 777 install-redis.sh
./install-redis.sh
#!/bin/bash | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
<html> | |
<head> | |
<title>jsonp test</title> | |
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
$('#select_link').click(function(e){ | |
e.preventDefault(); | |
console.log('select_link clicked'); | |
var data = "do shash'owania"; | |
var crypto = require('crypto'); | |
crypto.createHash('md5').update(data).digest("hex"); |
var url = "http://cdn1.giltcdn.com/images/share/uploads/0000/0001/7250/172502872/420x560.jpg"; | |
var encoded = new Buffer(url).toString('base64'); | |
var decoded = new Buffer(encoded, 'base64').toString('ascii') | |
console.log(encoded); | |
console.log(decoded); |
require 'tire' | |
# Tire.configure { logger STDERR, level: 'debug' } | |
Tire.index('movie-titles') do | |
delete | |
create \ | |
settings: { | |
index: { | |
analysis: { |
app.post('/login', function(req, res) { | |
console.log(res); | |
passport.authenticate('local', function(err, user) { | |
if (req.xhr) { | |
//thanks @jkevinburton | |
if (err) { return res.json({ error: err.message }); } | |
if (!user) { return res.json({error : "Invalid Login"}); } | |
req.login(user, {}, function(err) { | |
if (err) { return res.json({error:err}); } | |
return res.json( |
alias ng="npm list -g --depth=0 2>/dev/null" | |
alias nl="npm list --depth=0 2>/dev/null" |
sudo yum update
##Install Redis https://gist.github.com/dstroot/2776679
wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
chmod 777 install-redis.sh
./install-redis.sh
package springbatch; | |
import common.Greeting; | |
import org.springframework.batch.core.Job; | |
import org.springframework.batch.core.Step; | |
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; | |
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; | |
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; | |
import org.springframework.batch.core.launch.JobLauncher; | |
import org.springframework.batch.core.launch.support.SimpleJobLauncher; |
var express = require('express'), | |
app = express(); | |
app.listen(80); | |
app.get('/', function(req, res){ | |
var ua = req.header('user-agent'); | |
// Check the user-agent string to identyfy the device. | |
if(/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile|ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(ua)) { | |
res.sendfile(__dirname + '/mobile.html'); | |
} else { | |
res.sendfile(__dirname + '/index.html'); |