Skip to content

Instantly share code, notes, and snippets.

View oferreiro's full-sized avatar

Oséias Ferreira oferreiro

View GitHub Profile
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [463:49013]
:sshDenied - [0:0]
:sshDoor - [0:0]
:sshGate - [0:0]
:sshPatio - [0:0]
:sshReport - [0:0]
:sshTagAbuser - [0:0]
class Slide < ApplicationRecord
has_one :slide_content, dependent: :destroy
has_one :image, through: :slide_content, source: :content, source_type: Image
end
class SlideContent < ApplicationRecord
belongs_to :slide
belongs_to :content, polymorphic: true
end
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)
@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"
@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
require "json"
require "hashie"
instagram_json='{
"data": {
"type": "image",
"users_in_photo": [{
"user": {
"username": "kevin",
"full_name": "Kevin S",
"id": "3",
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"
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
@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
@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