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>
</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]
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 / dancer2_plugin_gh_auth.pl
Created September 26, 2013 18:13
Dancer2::Plugin::Github::Auth
package Dancer2::Plugin::Auth::Github;
use strict;
use warnings FATAL => 'all';
use Carp 'croak';
use Dancer2;
use Dancer2::Plugin;
use Digest::SHA qw(sha256_hex);
@gideondsouza
gideondsouza / test_github_plugin.pl
Created September 26, 2013 18:12
test app for my github authentication plugin
package YourDancerApplication;
use Dancer2;
use lib "../dancer2-plugin-auth-github/lib";
use Dancer2::Plugin::Auth::Github;
set 'session' => 'YAML';
auth_github_init();
@gideondsouza
gideondsouza / gist:6625505
Created September 19, 2013 15:50
tcl failure log
cpanm (App::cpanminus) 1.6942 on perl 5.012004 built for darwin-thread-multi-2level
Work directory is /Users/gideon/.cpanm/work/1379605518.67859
You have make /usr/bin/make
You have LWP 6.05
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching Tkx on cpanmetadb ...
--> Working on Tkx
Fetching http://www.cpan.org/authors/id/G/GA/GAAS/Tkx-1.09.tar.gz
-> OK
package YourDancerApplication;
use Dancer ':syntax';
use Dancer::Plugin::Auth::Github;
#You must use a session backend.
#You should be able to use any backend support by dancer.
set 'session' => 'Simple';
#make sure you call this first.
@gideondsouza
gideondsouza / my_app.pl
Created September 10, 2013 12:05
Simplest dancer app
#!/usr/bin/env perl
use Dancer;
get '/' => sub {
"Hello World!"
};
dance;