Skip to content

Instantly share code, notes, and snippets.

View exocode's full-sized avatar
🏠
Working from home

Jan exocode

🏠
Working from home
View GitHub Profile

All of the categories!

I wrote a really simple JavaScript script that uses jQuery to extract all the categories from Facebook's "Create a page" page.

Instructions

  1. Navigate to the Create a page page.
  2. jQuerify the page.
  3. Open up your JavaScript console of choice and run the following script:
@exocode
exocode / geo.rb
Created March 4, 2014 14:55 — forked from gilles/geo.rb
# geo.rb
# Formulas from
#
# haversine formula to compute the great circle distance between two points given their latitude and longitudes
#
# Copyright (C) 2008, 360VL, Inc
# Copyright (C) 2008, Landon Cox
#
# http://www.esawdust.com (Landon Cox)
# adapted from bin/sidekiq
# to invoke, run: zeus runner sidekiq.rb
require 'sidekiq/cli'
begin
cli = Sidekiq::CLI.instance
cli.parse
cli.run
rescue => e
require 'zeus/rails'
class CustomPlan < Zeus::Rails
def sidekiq
# Based on bin/sidekiq
require 'sidekiq/cli'
begin
cli = Sidekiq::CLI.instance
cli.parse
module ApplicationHelper
# ==== Examples
# glyph(:share_alt)
# # => <i class="icon-share-alt"></i>
# glyph(:lock, :white)
# # => <i class="icon-lock icon-white"></i>
def glyph(*names)
content_tag :span, nil, class: names.map{|name| "glyphicon-#{name.to_s.gsub('_','-')}" }
end
@exocode
exocode / readme.md
Created April 11, 2014 08:30 — forked from rmoriz/readme.md

HowTo use the Uservoice iOS SDK with RubyMotion

1. Register for e.g. the free plan on https://uservoice.com

2. checkout the sdk from github

cd your-motion-project/vendor
git clone https://github.com/uservoice/uservoice-iphone-sdk
#!/usr/bin/env ruby
require 'rubygems'
require "oauth"
require 'json'
def symbolize_hash(hash)
symbolized_hash = {}
puts hash.inspect
# adapted from bin/sidekiq
# to invoke, run: zeus runner sidekiq.rb
require 'sidekiq/cli'
begin
cli = Sidekiq::CLI.instance
cli.parse
cli.run
rescue => e
@exocode
exocode / gist:7b1b4f64d7260c953d61
Last active May 27, 2020 00:51
googlemaps4rails
rendered
<div class="widget-content">
<h5>Discothek Villa</h5>
<p>Bruckdorf 469, 5571, Mariapfarr, Austria</p>
<div id="map_wrapper">
<div id="map_sidebar"></div>
@exocode
exocode / gist:9302aed84fb6f6ee6c16
Created September 14, 2014 13:39 — forked from skorianez/gist:1308103
jCrop and Carrierwave
# https://github.com/gzigzigzeo/carrierwave-meta
# Integrating CarrierWave with JCrop
# Let implement the behavior like at this demo: deepliquid.com/projects/Jcrop/demos.php?demo=thumbnail
# The uploader:
class CropUploader < SobakaUploader
include CarrierWave::Meta
# Crop source is a source image converted from original which could be bigger than source area (left image in the example).
version :crop_source do