Skip to content

Instantly share code, notes, and snippets.

View oferreiro's full-sized avatar

Oséias Ferreira oferreiro

View GitHub Profile
@oferreiro
oferreiro / custom_plupload.js
Created August 2, 2011 13:53
plupload custom example
//= require plupload/plupload
//= require plupload/plupload.html4
//= require plupload/plupload.html5
$(function(){
var atoken = $("input[name=authenticity_token]").val();
var uploader = new plupload.Uploader({
runtimes : 'html5',
browse_button : 'pickfiles',
container : 'uploader',
@oferreiro
oferreiro / udpSender.cpp
Created August 8, 2012 16:57
sender function
#define UDP_HEAD_SIZE 65
#define UDP_MAX_DATA_SIZE 1034
#define UDP_MSG_SIZE UDP_HEAD_SIZE+UDP_MAX_DATA_SIZE+1
void udpSender::sendImage(){
int dataPosID = 0;
char *index = compressedBuffer.getBinaryBuffer();
char udpPack[UDP_MSG_SIZE];
char *udpHead = &udpPack[0];
char *udpData = &udpPack[UDP_HEAD_SIZE];
@oferreiro
oferreiro / nested_resource_with_namespace.rb
Created September 16, 2012 05:44
rota para nested resources dentro de namespace
namespace :admin do
resources :galleries do
#resource :images #wrong
resources :images #right
end
end
# admin/galleries/show.html.erb
@oferreiro
oferreiro / thin
Last active December 26, 2015 20:19
debian style thin init for rvm
#!/bin/sh
### BEGIN INIT INFO
# Provides: thin
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: thin initscript
# Description: thin
### END INIT INFO
class Certificate
include DataMapper::Resource
property :cn, String, key: true, length: 64, unique: true, required: true
property :crt, Text
property :pkey, Text
end
#Preciso deste novo.
class Certificate
include DataMapper::Resource
require "hashie/mash"
comments = Hashie::Mash.new
data = Hashie::Mash.new
from = Hashie::Mash.new
from.full_name="marc"
from.id="393529"
from.profile_picture="http://images.ak.instagram.com/profiles/profile_393529_75sq_1350234816.jpg"
from.username="marc"
require "json"
require "hashie"
instagram_json='{
"data": {
"type": "image",
"users_in_photo": [{
"user": {
"username": "kevin",
"full_name": "Kevin S",
"id": "3",
@oferreiro
oferreiro / unicorn
Last active January 1, 2016 11:09
Debian style unicorn init.d
#!/bin/bash
# /etc/init.d/unicorn
# ### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: unicorn service
@oferreiro
oferreiro / app-assets-javascripts-registers.js.coffee
Created August 18, 2014 19:42
Render a javacript on rails with haml.js
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
jQuery ->
setInterval(->
console.log "Getting table..."
$.ajax(
url: "/"
dataType: "script"
type: "GET"
efer vdd rstr freq init
[ 0.141445,0] msm-thermal qcom,msm-thermal.61: probe_ocr:Failed reading node=/soc/qcom,msm-thermal, key=qti,pmic-opt-curr-temp. KTM continues
[ 0.161470,0] No ATAGs?
[ 0.161599,1] ------------[ cut here ]------------
[ 0.161812,1] WARNING: at ../../../../../../kernel/motorola/msm8610/arch/arm/kernel/hw_breakpoint.c:259 enable_monitor_mode+0xa8/0xb4()
[ 0.162086,1] Failed to enable monitor mode on CPU 1.
[ 0.162189,1] Modules linked in:
[ 0.162404,1] [<c010c4cc>] (unwind_backtrace+0x0/0xec) from [<c017b0c0>] (warn_slowpath_common+0x54/0x64)
[ 0.162604,1] [<c017b0c0>] (warn_slowpath_common+0x54/0x64) from [<c017b100>] (warn_slowpath_fmt+0x30/0x40)
[ 0.162803,1] [<c017b100>] (warn_slowpath_fmt+0x30/0x40) from [<c010d4d4>] (enable_monitor_mode+0xa8/0xb4)