Skip to content

Instantly share code, notes, and snippets.

View hotsoft-desenv2's full-sized avatar
🖥️
Working

Wellington Torrejais da Silva - Hotsoft_desenv2 hotsoft-desenv2

🖥️
Working
View GitHub Profile
@hotsoft-desenv2
hotsoft-desenv2 / gist:467f22e991b7e29ba4a49a31a7209ca5
Created April 2, 2019 12:33 — forked from viola/gist:1070410
Example of fetching Hash (key,value) to the simple_form collection.
-- model
some sort of constant hash:
HASH_NAME = {
0 => "Choose:",
1 => "On-Campus Recruiting - CSO",·
2 => "CSO Staff Referral",
3 => "Faculty Contact",·
4 => "Career Day",·
5 => "CSO Summer Job Listing",·
6 => "Alumni Contact",·
@hotsoft-desenv2
hotsoft-desenv2 / gist:84fc17026a327a41b3170e1b195ff2f8
Created December 19, 2017 11:41 — forked from fabriciocolombo/gist:4279304
Capturing console output with Delphi
//Anonymous procedure approach by Lars Fosdal
type
TArg<T> = reference to procedure(const Arg: T);
procedure TForm1.CaptureConsoleOutput(const ACommand, AParameters: String; CallBack: TArg<PAnsiChar>);
const
CReadBuffer = 2400;
var
saSecurity: TSecurityAttributes;
hRead: THandle;
@hotsoft-desenv2
hotsoft-desenv2 / rails http status codes
Created April 17, 2017 14:43 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
# from: http://kfahlgren.com/blog/2006/11/01/multipart-post-in-ruby-2/
# edited by makevoid, http://makevoid.com
URL = "http://localhost:3000/your_url"
TIMEOUT_SECONDS = 10
params = {}
file = File.open(filename, "rb")
params["file[replay]"] = file