Skip to content

Instantly share code, notes, and snippets.

View leostera's full-sized avatar
🛠️
ars longa vita brevis

Leandro Ostera leostera

🛠️
ars longa vita brevis
View GitHub Profile
@leostera
leostera / gist:1925857
Created February 27, 2012 17:54 — forked from defunkt/gist:6443
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@leostera
leostera / gist:4008305
Created November 3, 2012 19:07
Access DB
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Formularios;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
--- growl.new/Plugins/Actions/SMS/GrowlSMSDisplay.m 2013-04-24 12:50:06.000000000 -0700
+++ growl/Plugins/Actions/SMS/GrowlSMSDisplay.m 2013-04-24 12:38:47.000000000 -0700
@@ -138,7 +138,7 @@
CFDataRef postData = CFStringCreateExternalRepresentation(kCFAllocatorDefault, dataString, kCFStringEncodingUTF8, 0U);
CFURLRef clickatellURL = CFURLCreateWithString(kCFAllocatorDefault, CFSTR("https://api.clickatell.com/xml/xml"), NULL);
NSMutableURLRequest *post = [[NSMutableURLRequest alloc] initWithURL:(NSURL *)clickatellURL];
- CFStringRef contentLength = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%u"), CFDataGetLength(postData));
+ CFStringRef contentLength = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%lu"), CFDataGetLength(postData));
// NSLog(@"SMS display: Sending data: %@", postData);
`import DS from 'ember-data'`
# https://aws.amazon.com/articles/1434
Policy = DS.Model.extend
key: DS.attr('string')
bucket: DS.attr('string')
acl: DS.attr('string')
'AWSAccessKeyId': DS.attr('string')
'Content-Type': DS.attr('string')
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
helper_method :current_user
alias_method :devise_current_user, :current_user
def current_user
@current_user ||= if session[:user_id]
$(document).ready(function() {
$("#events_search input").keyup(function() {
timer = setTimeout(function() {
$.get($("#events_search").attr("action"), $("#events_search").serialize(), null, "script");
$('#events-partial').addClass('animated fadeIn');
window.setTimeout( function(){
$('#events-partial').removeClass('animated fadeIn');
}, 600);
return false;
}, 2000);
1 ASPMX.L.GOOGLE.COM
5 ALT1.ASPMX.L.GOOGLE.COM
5 ALT2.ASPMX.L.GOOGLE.COM
10 ALT3.ASPMX.L.GOOGLE.COM
10 ALT4.ASPMX.L.GOOGLE.COM
-module(shiftand).
%% shiftand:match("announce", "annual_announce").
-export([match/2]).
match(Pattern, Text) ->
PatLen = length(Pattern),
BitMaskTable = init_table(Pattern),
MatchMask = 1 bsl (PatLen - 1),
@leostera
leostera / ask_area.erl
Last active August 29, 2015 14:27
ask_area.erl
-module(ask_area).
-export([print_area/0]).
print_area() ->
try area() of
Area -> io:format("The area is ~p~n", [Area])
catch
error:Err -> io:format("~s~n", [error_msg(Err)])
end.
@leostera
leostera / README.md
Created April 19, 2016 07:48 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.