Skip to content

Instantly share code, notes, and snippets.

View sbusso's full-sized avatar
🤖
Crafting with AI friends

Stéphane Busso sbusso

🤖
Crafting with AI friends
View GitHub Profile
@sbusso
sbusso / rails_admin_fr
Created February 3, 2012 12:56 — forked from bbenezech/rails_admin_fr
French translation for RailsAdmin
fr:
home:
name: Home
views:
pagination:
previous: "« Préc."
next: "Suiv. »"
truncate: "…"
admin:
misc:
@sbusso
sbusso / simple_ruby_daemon.rb
Created March 5, 2012 13:50 — forked from mynameisrufus/.gitignore
Simple ruby daemon
#!/usr/bin/env ruby
# == Simple Daemon
#
# A simple ruby daemon that you copy and change as needed.
#
# === How does it work?
#
# All this program does is fork the current process (creates a copy of
# itself) then exits, the fork (child process) then goes on to run your
# daemon code. In this example we are just running a while loop with a
@sbusso
sbusso / .gitignore
Created March 21, 2012 17:25 — forked from karmi/.gitignore
Import your Gmail messages into ElasticSearch and search them with a simple web application.
.DS_Store
*.log
Gemfile.lock
@sbusso
sbusso / elasticoverflow.rb
Created March 22, 2012 02:57 — forked from karmi/elasticoverflow.rb
Importing and searching RSS with ElasticSearch and Tire
# =======================================================
# Importing and searching RSS with ElasticSearch and Tire
# =======================================================
#
# This script downloads, parses and indexes Stackoverflow RSS feed with ElasticSearch
# via the [Tire](https://github.com/karmi/tire) Rubygem.
#
# Requirements
# ------------
#
@sbusso
sbusso / _readme.markdown
Created March 22, 2012 03:12 — forked from karmi/_readme.markdown
Simplistic Full-Text Search With Redis' Sorted Sets

Simplistic Full-Text Search With Redis's Sorted Sets

Howto

git clone git://gist.github.com/923934.git redisearch

cd redisearch
@sbusso
sbusso / .gitignore
Created March 22, 2012 03:17 — forked from karmi/.gitignore
Visualizing timelines with Protovis and date histogram facet in ElasticSearch
.DS_Store
tmp/
@sbusso
sbusso / opml_generator.rb
Created April 2, 2012 07:34 — forked from jpmckinney/opml_generator.rb
Given an array of URLs, outputs an OPML file to STDOUT
# blog post: http://blog.slashpoundbang.com/post/3385815540/how-to-generate-an-opml-file-with-ruby
require 'open-uri'
require 'builder'
require 'truffle-hog'
require 'nokogiri'
# CHANGE ME
urls = %w(http://example.com/ http://example.org/)
@sbusso
sbusso / gist:2897330
Created June 8, 2012 18:07 — forked from jittuu/gist:792715
Test Omniauth Facebook Callback Controllers in Devise with rspec
require 'spec_helper'
describe Users::OauthCallbacksController, "handle facebook authentication callback" do
describe "#annonymous user" do
context "when facebook email doesn't exist in the system" do
before(:each) do
stub_env_for_omniauth
get :facebook
@sbusso
sbusso / getscript.js
Created September 5, 2012 06:47
getScript() - load scripts asynchronously w/375 bytes of code - e.g. `getScript(src, cb)`
// # getScript()
// more or less stolen from jquery core and adapted by paul irish
function getScript(url,success) {
var head = document.getElementsByTagName("head")[0], done = false;
var script = document.createElement("script");
script.src = url;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function(){
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) {
@sbusso
sbusso / backup.rb
Created October 31, 2012 02:04
Gitlab HQ backup script
require 'rubygems'
require 'active_record'
require 'yaml'
require 'logger'
require 'fileutils'
require 'aws/s3'
ROOT = File.expand_path(File.dirname(__FILE__))
CONFIG = YAML.load_file(File.join(ROOT, "config", "database.yml"))
TMP_BACKUP = File.join(ROOT, "tmp", "backup")