This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>promise demo</title> | |
<style> | |
div { | |
height: 50px; | |
width: 50px; | |
float: left; |
This file contains 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
FROM ubuntu:13.10 | |
RUN apt-get update | |
RUN apt-get install -y nodejs npm | |
ADD . /src | |
RUN cd /src; npm install | |
EXPOSE 8080 | |
CMD ["nodejs", "/src/app.js"] |
This file contains 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
# Dockerfile for mbc-caspa | |
FROM ubuntu:13.10 | |
MAINTAINER Leonardo Vidarte, lvidarte@gmail.com | |
ADD . /src | |
RUN apt-get update; apt-get install -y git nodejs npm gettext mongodb redis-server ffmpeg | |
RUN ln -s /usr/bin/nodejs /usr/bin/node; mkdir -p /data/db | |
RUN cd /src; git clone http://github.com/inaes-tic/mbc-caspa.git | |
RUN cd /src/mbc-caspa; sed -i 's/beta4//' package.json; make update | |
ENTRYPOINT /bin/sh /src/start.sh | |
EXPOSE 3000 |
This file contains 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
#!/bin/bash | |
export LANG=en_US.UTF-8 | |
S3_LOG=/tmp/s3.log | |
S3_PID=/tmp/s3.pid | |
MMIN=30 # minutes to wait the process finish | |
function log() |
This file contains 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
private function queryBuilder($params) | |
{ | |
$queryBuilder = $this->conn->createQueryBuilder(); | |
$queryBuilder | |
->select( | |
'p.id', 'p.nombre name', 'precio_ref referencePrice', | |
'p.categoria_id categoryId', 'precio_venta sellPrice', | |
'img_catalogo image', 'descripcion description', | |
'publicado published', 'alt imageAlt', |
This file contains 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 files = [ | |
'coquelux.01.08.01.tar.gz', | |
'coquelux.01.08.09.tar.gz', | |
'coquelux.01.08.100.tar.gz', | |
'coquelux.01.08.10.tar.gz', | |
'coquelux.01.08.99.tar.gz', | |
]; | |
var getLatestVersion = function(files) { | |
var latestVersion = [0, 0, 0]; |
This file contains 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
import sys | |
import pyinotify | |
from datetime import datetime | |
wm = pyinotify.WatchManager() | |
mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | |
files = {} | |
class EventHandler(pyinotify.ProcessEvent): |
This file contains 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
#!/usr/bin/ruby | |
require 'mysql' | |
if ! ARGV[0] or ! ARGV[1] | |
puts "Usage: ./bench THREADS QUERIES" | |
abort | |
end | |
threads = ARGV[0].to_i |
This file contains 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
1. | |
tmux | |
exit [C-d] | |
Prefix d # detaches from session | |
2. Sessions | |
tmux new -s [name] | |
tmux attach | |
tmux ls | |
tmux attach -t [name] |
This file contains 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
import timeit | |
import hashlib | |
def get_hash(passwd, n=100): | |
hash = passwd | |
for i in xrange(n): | |
hash = hashlib.md5(hash).hexdigest() | |
return hash |
OlderNewer