Skip to content

Instantly share code, notes, and snippets.

View lunks's full-sized avatar

Pedro Nascimento lunks

View GitHub Profile
diff --git a/app/assets/javascripts/angular/apps/teachers/controllers/NotificationCtrl.js.coffee b/app/assets/javascripts/angular/apps/teachers/controllers/NotificationCtrl.js.coffee
index 0bc054e..0e616ab 100644
--- a/app/assets/javascripts/angular/apps/teachers/controllers/NotificationCtrl.js.coffee
+++ b/app/assets/javascripts/angular/apps/teachers/controllers/NotificationCtrl.js.coffee
@@ -25,10 +25,20 @@ NotificationCtrl = ($scope, $timeout, $analytics, Notification, ErrorParser)->
course = $scope.$parent.course
notification.course_id = course.uuid
notification.abbreviation = course.abbreviation
- notification.save().then(->
+ notification.save().then((response)->
@lunks
lunks / petroleo.lua
Created January 27, 2015 09:51
Código macarrônico pro trabalho final de Introdução à Ciência da Computação ministrada pelo Prof. Mauricio Kischinhevsky, na UFF. 1o. lugar em 2/2008. O algoritmo é pra ser rodado usando o programa Robots V2, disponível em http://www.inf.puc-rio.br/~mascarenhas/robots/
p = 20 -- 1 segundo
maparuim = 0
voltadinhe = 0
emergencia = 0
segundo = 0
dinhe = 0
b = 0
andaratoa=0
perfuracao = 0
pressaoboa = 0.7
class people::lunks {
include macvim
include adium
include caffeine
include chrome
include dropbox
include gitx::dev
include iterm2::stable
include karabiner
include mou
#!/usr/bin/env lua
-- This file:
-- http://angg.twu.net/fbcache/urls.lua
-- http://angg.twu.net/fbcache/urls.lua.html
-- (find-angg "fbcache/urls.lua")
-- 2014sep07
-- (defun u () (interactive) (find-angg-upload-links "fbcache/" "urls.lua"))
--
-- (find-lua51manualw3m "")
@lunks
lunks / without_oj.json
Created October 9, 2014 06:35
OJ NoMemoryError: Too deeply nested bug with simple JSON
{"id":43,"content":"Some message here","created_at":"2014-10-09T03:33:30.355-03:00","updated_at":"2014-10-09T03:33:30.355-03:00","student_id":192,"uuid":"b4a9d16e-5846-4ec8-8793-3d834a1a3c1b"}
class Person
def initialize
@attributes = {}
end
def attributes
@attributes.dup.freeze
end
def name
<script type="text/javascript">
$('.the-posts .posts-grid').prepend('.sticky');
</script>
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_filter :set_locale
private
def set_locale
if params[:locale]
I18n.locale = params[:locale]
@lunks
lunks / sites.coffee
Created July 3, 2014 02:46
Backbone Collection with subModels using backbone-relational (not working)
Dashboard.module 'Entities', (Entities, Dashboard, Backbone, Marionette, $, _) ->
class Entities.Site extends Backbone.RelationalModel
relations: [
{
type: Backbone.HasMany
key: 'widgets'
relatedModel: 'Dashboard.Entities.Widget'
parse: true
relatedCollection: 'Dashboard.Entities.WidgetCollection'
reverseRelation: {
class Attendee < ActiveRecord::Base
devise :invitable, :rememberable, :trackable, :omniauthable,
:registerable, :database_authenticatable, :recoverable
has_many :reservations, through: :invites
has_many :invites, foreign_key: :guest_id
end