Skip to content

Instantly share code, notes, and snippets.

💭
Decentralize and democratize the Web.

Jacky Alciné jalcine

💭
Decentralize and democratize the Web.
Block or report user

Report or block jalcine

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jalcine
jalcine / 01. Gemfile
Created Sep 6, 2012 — forked from schleg/01. Gemfile
Setup for Devise + Omniauth
View 01. Gemfile
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'
@jalcine
jalcine / dabblet.css
Created Sep 18, 2012 — forked from LeaVerou/dabblet.css
Fixed width, fluid background
View dabblet.css
/**
* Fixed width, fluid background
*/
body { margin: 0; font-family: Futura, sans-serif; }
h1 { margin-top: 0 }
section {
width: 700px;
@jalcine
jalcine / omniauth.rb
Created Oct 2, 2012 — forked from dira/omniauth.rb
OmniAuth strategy for a custom provider
View omniauth.rb
# config/initializers/omniauth.rb
module OmniAuth
module Strategies
# tell OmniAuth to load our strategy
autoload :Pixelation, 'lib/pixelation_strategy'
end
end
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, "app_name", "secret"
@jalcine
jalcine / application.html.erb
Created Oct 2, 2012 — forked from rdetert/application.html.erb
How to logout completely from Facebook using Ruby on Rails and Devise + Omniauth. I'm just modifying the Omniauth Railscast http://railscasts.com/episodes/236-omniauth-part-2
View application.html.erb
<div id="user_nav">
<% if user_signed_in? %>
<img src="<%= user_avatar %>" id="main_avatar"> Signed in as <%= current_user.email %>.<br />
Not you?
<% if session[:fb_token].nil? %>
<%= link_to "Sign out", destroy_user_session_path %>
<% else %>
<%= link_to "Sign out", facebook_logout_path %>
<% end %>
@jalcine
jalcine / gist-1.sh
Created Oct 3, 2012 — forked from rondale-sc/gist-1.sh
setting-up-a-remote-environment
View gist-1.sh
$ vi ~/.ssh/config
# Add the following information
Host rails_blog_db
HostName 0.0.0.0 # your remote's public facing IP
Port 3122
User jjackson # your username
LocalForward 3307 192.168.100.1:3306
@jalcine
jalcine / gitio
Created Oct 8, 2012 — forked from defunkt/gitio
Turn a github.com URL into a git.io URL.
View gitio
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
View AndroidManifext.xml
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
@jalcine
jalcine / example.rb
Created Oct 13, 2012
Role Hierarchy in Rolify
View example.rb
# A lot of times, you might have multiple roles in your User model.
# Also, at times, you keep the administrative users and regular users (if you may) in the
# same model. This can lead to a few issues when attempting to assign multiple roles
# to users.
# A potential use-case could be as follows:
# file: app/controllers/foo_controller.rb
magic_user = User.find_by_foo(:bar)
@jalcine
jalcine / namespace.coffee
Created Oct 25, 2012
Implementing Namespaces in CoffeeScript and JavaScript
View namespace.coffee
# Define the global namespace as 'root'.
root = module?.parent?.exports ? window
###
@fn namespace
Allows you to implement a namespace of objects to the global namespace.
###
root.namespace = ->
separator = "."
@jalcine
jalcine / gist:4243722
Created Dec 9, 2012 — forked from fennb/gist:1139016
Chromium speech recognition details
View gist:4243722
const int SpeechRecognizer::kAudioSampleRate = 16000;
const int SpeechRecognizer::kAudioPacketIntervalMs = 100;
const ChannelLayout SpeechRecognizer::kChannelLayout = CHANNEL_LAYOUT_MONO;
const int SpeechRecognizer::kNumBitsPerAudioSample = 16;
const int SpeechRecognizer::kNoSpeechTimeoutSec = 8;
const int SpeechRecognizer::kEndpointerEstimationTimeMs = 300;
// ...
const char* const kContentTypeSpeex = "audio/x-speex-with-header-byte; rate=";
const int kSpeexEncodingQuality = 8;
const int kMaxSpeexFrameLength = 110; // (44kbps rate sampled at 32kHz).
You can’t perform that action at this time.