Skip to content

Instantly share code, notes, and snippets.

View ohcibi's full-sized avatar
🕴️
Elevated

Tobias Witt ohcibi

🕴️
Elevated
View GitHub Profile
@ohcibi
ohcibi / danger.md
Last active August 29, 2015 14:15
Thoughts on upgrading ember-cli addons' ember-cli

!!!WARNING!!! THIS IS TOTAL WIP. NOBODY KNOWS IF THIS IS GOOD. NOBODY KNOWS IF THIS IS BAD. DONT READ THIS, IF YOU ARE SEARCHING FOR HELP IN ANY KIND!!!

  1. Change version of ember-cli in package.json to the version to upgrade,
  2. npm install
  3. ember generate addon <name-of-your-addon>
  4. Overwrite all files (assuming the addon is in SCM)
  5. Merge in/discard changes from overwriting the files with help of SCM
  6. Done
define ->
COURSES =
#...
app.import("app/lib/courses.coffee", {
exports: [
"COURSES"
]
});
@ohcibi
ohcibi / imp.rb
Last active August 29, 2015 14:10
class Imp < ActiveRecord::Base
validates :name, :email, :calendar, presence: true
validates :email, uniqueness: true
validate :rest_of_calendar
def rest_of_calendar
if self.class.where(calendar: calendar).length > 24
errors.add :calendar, "#{calendar} is full"
end
end
define [
"initializers/terms_array_constant"
"initializers/alternatives"
], (initializers...) -> initializers
[color]
ui = always
[push]
default = simple
[pull]
default = simple
[alias]
co = checkout
ci = commit --verbose
#Log display from screencast, with train tracks.
def f(a):
r = []
for v in a:
def g():
print(v)
r.append(g)
return r
a = f([1, 2, 3])
Name: owncloud
Guest OS: Debian (64 bit)
UUID: 74446b99-3c63-40d6-83ef-14eb74121bb6
Config file: /home/ohcibi/VirtualBox VMs/owncloud/owncloud.vbox
Snapshot folder: /home/ohcibi/VirtualBox VMs/owncloud/Snapshots
Log folder: /home/ohcibi/VirtualBox VMs/owncloud/Logs
Hardware UUID: 74446b99-3c63-40d6-83ef-14eb74121bb6
Memory size: 128MB
Page Fusion: off
VRAM size: 8MB
x = 0
y = 5
a = <ZZZ# ~
y = 0
<ZZZ# ~
ret = 0
if y:
context context x = 7
ret = x
else:
Em.Application.initializer
name: "injectAlternativesController"
initialize: (container, application) ->
container.register "alternatives:main", AlternativesController,
singleton: true
application.inject(
"view:timeslot", "alternatives", "alternatives:main"
)