Skip to content

Instantly share code, notes, and snippets.

View sebastialonso's full-sized avatar

Sebastián González sebastialonso

View GitHub Profile
@heldrida
heldrida / javascript
Last active March 11, 2024 17:00
Facebook Javascript SDK: Basic Login and Logout example
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: 'xxxxxxxxxxxxx',
status: true,
cookie: true,
xfbml: true
});
@christiannelson
christiannelson / 0.config
Created November 26, 2012 00:08
Using HAProxy with Node.js, Socket.io and SSL
global
nbproc 1
maxconn 65536
defaults
timeout connect 5s
timeout queue 5s
timeout server 30s
timeout tunnel 1h
@pamelafox
pamelafox / phonegap-photofetcher.js
Created March 23, 2012 18:32
PhoneGap Convert Photo File URI to Data URI
function getPhoto() {
navigator.camera.getPicture(onPhotoSuccess, onPhotoFail,
{quality: 70, targetWidth: 500, targetHeight: 500,
sourceType: navigator.camera.SourceType.PHOTOLIBRARY,
destinationType: navigator.camera.DestinationType.FILE_URI,
});
}
function onPhotoSuccess(imageUri) {
var $img = $('<img/>');
@scottwb
scottwb / application_controller.rb
Created February 17, 2012 06:12
Get a list of all the filters on a given Rails 3 controller.
# Add these methods to your ApplicationController. Then, any controller
# that inherits from it will have these methods and can programmatically
# determine what filters it has set.
class ApplicationController < ActionController::Base
def self.filters(kind = nil)
all_filters = _process_action_callbacks
all_filters = all_filters.select{|f| f.kind == kind} if kind
all_filters.map(&:filter)
end
@hastebrot
hastebrot / list_plugins.rb
Created November 12, 2011 23:22
OpenJUMP 1.4.2 Plugin List
import "com.vividsolutions.jump.workbench.ui.AttributeTab"
import "com.vividsolutions.jump.workbench.ui.LayerViewPanel"
workbench_frame = $wc.workbench.frame
menu_bar = workbench_frame.get_jmenu_bar()
tool_bar = workbench_frame.get_tool_bar() # as JToolBar
layer_name_popup_menu = workbench_frame.get_layer_name_popup_menu()
category_popup_menu = workbench_frame.get_category_popup_menu()