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
<style> | |
#dropZone { | |
color: #555; | |
font-size: 18px; | |
text-align: center; | |
width: 400px; | |
padding: 50px 0; | |
margin: 50px auto; |
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
-module(upload_handler). | |
-behaviour(cowboy_http_handler). | |
-export([init/3, handle/2, terminate/2]). | |
init({_Transport, http}, Req, []) -> | |
{ok, Req, {}}. | |
handle(Req, State) -> | |
{Method,Req2} = cowboy_http_req:method(Req), | |
case Method of |
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
%%%------------------------------------------------------------------- | |
%%% @author egobrain <egobrain@linux-ympb> | |
%%% @copyright (C) 2012, egobrain | |
%%% @doc | |
%%% Function for uploading files and properties,which were sent as a | |
%%% multipart. Files are stored in tmp_folder with random name, | |
%%% generated by tmp_filename function. | |
%%% @end | |
%%% Created : 25 Mar 2012 by egobrain <egobrain@linux-ympb> | |
%%%------------------------------------------------------------------- |
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 | |
usage() { | |
cat <<EOF | |
usage: $(basename $0) [OPTIONS] | |
This script run make in folder | |
if file of specific type is changed | |
OPTIONS: |
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
-define(atom(Atom),erl_syntax:atom(Atom)). | |
-define(var(Var),erl_syntax:variable(Var)). | |
-define(underscore,erl_syntax:underscore()). | |
-define(apply(Fun,Args),erl_syntax:application(?atom(Fun),Args)). | |
-define(apply(Mod,Fun,Args),erl_syntax:application(?atom(Mod),?atom(Fun),Args)). | |
-define(apply_(Fun,Args),erl_syntax:application(Fun,Args)). | |
-define(clause(Pattern,Guard,Body),erl_syntax:clause(Pattern,Guard,Body)). | |
-define(cases(Arg,Clauses),erl_syntax:case_expr(Arg,Clauses)). | |
-define(ifs(Clauses),erl_syntax:if_expr(Clauses)). |
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
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled. | |
Using the code from twitter bootstrap documentation page, this code is customized for table header. | |
Create the table with following layout - | |
<table class="table-fixed-header"> | |
<thead class="header"> | |
<tr> | |
<th>Column 1</th> | |
<th>Column 2</th> | |
<th>Column 3</th> |
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
CallOnceConstructor = -> | |
cache = {} | |
(f) -> | |
cache.f_link?.f = null | |
f_link = f: f | |
cache.f_link = f_link | |
-> f_link.f?.apply null, arguments | |
# example | |
# call_last = CallOnceConstructor() |
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 CallOnceConstructor = function () { | |
var cache = {}; | |
return function (f) { | |
if (cache.f_link) {cache.f_link.f = null}; | |
var f_link = {f: f}; | |
cache.f_link = f_link | |
return function() { | |
if (f_link.f) f_link.f.apply(null, arguments); | |
}; | |
} |
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
# ~/.bashrc: executed by bash(1) for non-login shells. see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# add local bin path | |
PATH=$HOME/.bin:$PATH | |
PATH=/usr/local/bin:$PATH | |
PATH=/usr/local/sbin:$PATH | |
PATH=/usr/local/mysql/bin:$PATH |
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
<html> | |
<head> | |
<title>Test remember password</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$('#login-button').click(function (ev) { | |
alert('AJAX login...'); | |
}); |
OlderNewer