Skip to content

Instantly share code, notes, and snippets.

View gideondsouza's full-sized avatar

Gideon Israel Dsouza gideondsouza

  • Dransfeld, Germany
View GitHub Profile
<html>
<head>
<title>Image Upload</title>
<link rel="stylesheet" type="text/css" href="uploadify.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.uploadify.min.js"></script>
</head>
<body>
<h1>Upload Images</h1>
require 'sinatra'
get '/' do
erb :form_multiple
end
post '/upload' do
#this method will get as ajax call for every file uploaded
@filename = params[:Filename]
file = params[:Filedata][:tempfile]
<html>
<head>
<title>Show Image</title>
</head>
<body>
<h1>See Image</h1>
<img src="<%= @filename %>" />
</body>
</html>
<html>
<head>
<title>Image Upload</title>
</head>
<body>
<h1>Upload Image</h1>
<form action="/save_image" method="POST" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" value="Upload image">
require 'sinatra'
get "/" do
erb :form
end
post '/save_image' do
@filename = params[:file][:filename]
file = params[:file][:tempfile]
@gideondsouza
gideondsouza / $uj.js
Created February 20, 2015 08:31
Javascript Basic code
window.$uj = function(fn)
{
if (window.addEventListener)
window.addEventListener("load", fn, false);
else if (window.attachEvent) {
window.attachEvent("onload", fn);
}
}
00000000000i[ ] Bochs x86 Emulator 2.6.2.svn
00000000000i[ ] Built from SVN snapshot after release 2.6.2
00000000000i[ ] Compiled on Oct 17 2013 at 20:19:45
00000000000i[ ] System configuration
00000000000i[ ] processors: 1 (cores=1, HT threads=1)
00000000000i[ ] A20 line support: yes
00000000000i[ ] IPS is set to 1000001
00000000000i[ ] CPU configuration
00000000000i[ ] SMP support: no
00000000000i[ ] level: 6
@gideondsouza
gideondsouza / quick-sort.pl
Created October 20, 2013 12:15
elegant perl quick sort
use strict;
use warnings;
use v5.10;
sub sort_
{
my @xs = @_;
if(scalar(@xs) == 0) {return ();}
my @lesser = sort_(grep { $_ < $xs[0] } @xs);
my @greater = sort_(grep { $_ > $xs[0] } @xs);
Gideons-Mac-mini:compiler gideon$ g++ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS=1 -o parser parser.cpp tokens.cpp main.cpp
Undefined symbols for architecture x86_64:
"_LLVMLinkInJIT", referenced from:
(anonymous namespace)::ForceJITLinking::ForceJITLinking()in ccax3uOX.o
"CodeGenContext::generateCode(NBlock&)", referenced from:
_main in ccax3uOX.o
"CodeGenContext::runCode()", referenced from:
_main in ccax3uOX.o
"llvm::getGlobalContext()", referenced from:
CodeGenContext::CodeGenContext()in ccax3uOX.o
@gideondsouza
gideondsouza / 0001-Updated-known_pod_issues-by-running-.-perl-podcheck..patch
Created October 3, 2013 15:40
0001-Updated-known_pod_issues-by-running-.-perl-podcheck..patch
From d233e024722a0d05ce9d70eeeaaffa0517579ea2 Mon Sep 17 00:00:00 2001
From: Gideon Israel Dsouza <gidisrael@gmail.com>
Date: Wed, 2 Oct 2013 21:12:21 +0530
Subject: [PATCH 1/3] Updated known_pod_issues by running ./perl podcheck.t
--regen
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.7.12.4 (Apple Git-37)"
This is a multi-part message in MIME format.
--------------1.7.12.4 (Apple Git-37)