Skip to content

Instantly share code, notes, and snippets.

View hilios's full-sized avatar
🛠️
Breaking stuff

Edson Hilios hilios

🛠️
Breaking stuff
View GitHub Profile
@hilios
hilios / HowToOTG.md
Created November 16, 2016 01:24 — forked from gbaman/HowToOTG.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@hilios
hilios / README.md
Last active July 4, 2022 15:36 — forked from mhayes/supervisord.sh
init.d for supervisord for Amazon Linux AMI

Auto start for Supervisord at AWS

Install commands
$ sudo mv supervisor /etc/init.d
$ sudo chkconfig --add supervisor
$ sudo chkconfig supervisor on

How to set a fix IP in Intel Edsion

Edit the file /etc/wpa_supplicant/wpa_cli-actions.sh around the line 50.

$ vim /etc/wpa_supplicant/wpa_cli-actions.sh

Close to the line 50 change it to this.

@hilios
hilios / rAF.js
Created April 22, 2013 23:34 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@hilios
hilios / Rakefile
Created August 2, 2012 18:26 — forked from jeffreyiacono/Rakefile
rake task for precompiling assets using sprockets within a sinatra app + view helpers
require 'rubygems'
require 'bundler'
Bundler.require
require './application'
namespace :assets do
desc 'compile assets'
task :compile => [:compile_js, :compile_css] do
end
@hilios
hilios / gist:2962111
Created June 20, 2012 20:46 — forked from travis/gist:1084767
testing facebook connect with capybara and rspec
require 'mogli'
module FacebookIntegrationHelpers
shared_context "with unconnected facebook user" do
let(:fb_user) { create_test_user(installed: false) }
after { fb_user.destroy }
end
def app_client
Mogli::AppClient.new(AppConfig.facebook.access_token, AppConfig.facebook.app_id)
@hilios
hilios / .vimrc
Last active August 2, 2016 16:59
vimrc - Personalizado
set cursorline
set hlsearch
set number
set ruler
set shiftwidth=2
set tabstop=2
syntax on
@hilios
hilios / action_dispatch_extensions.rb
Created October 28, 2011 13:26 — forked from tokland/action_dispatch_extensions.rb
How to add locale scope to i18n_routing
class ActionDispatch::Routing::Mapper
def localize_and_scope_for(locales, options = {}, &block)
scoped_locales = locales - Array(options[:skip_scope])
localized(locales) do
locale_regexp = Regexp.new(scoped_locales.join('|'))
scope("/:i18n_locale", :constraints => {:i18n_locale => locale_regexp}) do
yield
end
yield if options[:skip_scope]