Skip to content

Instantly share code, notes, and snippets.

View abe33's full-sized avatar

Cédric Néhémie abe33

  • Clermont-Ferrand, France
View GitHub Profile
@abe33
abe33 / form.html.haml
Last active January 2, 2016 19:28
nested_form and strong_parameters issues with 2 nested models forms. The customs gem (https://github.com/inkstak/customs) is used to provide basic resource flow in controllers (hence the `resource_params` method)
-# Here resource is the timeline
= simple_nested_form_for resource, url: [resource] do |form|
%table.nested_form
= form.fields_for :marker_sections, wrapper: false do |section_form|
%tr.fields
%td
%table.nested_form
%thead
%tr.section
@abe33
abe33 / abe.itermcolors
Created December 30, 2015 15:23
Iterm setup
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.18021853268146515</real>

Keybase proof

I hereby claim:

  • I am abe33 on github.
  • I am abe33 (https://keybase.io/abe33) on keybase.
  • I have a public key whose fingerprint is B5DD F04C 3132 C101 740F 2755 5BCA E0C4 DEDF 3CF0

To claim this, I am signing this object:

@abe33
abe33 / collector.coffee
Created February 23, 2015 15:19
Collect markdown preview styles
rules = []
ruleRegExp = /\.markdown-preview/
for stylesheet in document.styleSheets
if stylesheet.rules?
for rule in stylesheet.rules
if rule.selectorText?.match(ruleRegExp)?
rules.push(rule.cssText)
console.log rules.join('\n')
@abe33
abe33 / element.coffee
Created February 13, 2015 14:08
Styleguide Example
class StyleguideItemElement extends HTMLElement
createdCallback: ->
console.log 'here'
@shadowRoot = @createShadowRoot()
@contentContainer = document.createElement('div')
content = document.createElement('content')
content.setAttribute('select', '*')
@abe33
abe33 / gist:5eb47ce6fcab93e0fed2
Created January 22, 2015 09:54
atom-shell crash with dropbox
Process: Atom [1123]
Path: /Users/USER/Desktop/EktatekDesktopClient.app/Contents/MacOS/Atom
Identifier: com.github.atom-shell
Version: 0.20.5
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Atom [1123]
User ID: 501
Date/Time: 2015-01-21 17:41:13.334 +0100
@abe33
abe33 / package.json
Created December 4, 2014 09:08
project-palette-finder package.json
{
"name": "project-palette-finder",
"main": "./lib/project-palette-finder",
"version": "2.4.2",
"description": "Finds and archive colors defined in a project's less/sass/stylus files",
"repository": {
"type": "git",
"url": "https://github.com/abe33/atom-project-palette-finder"
},
"license": "MIT",
@abe33
abe33 / requirePackages.coffee
Last active August 29, 2015 14:08
Requires many Atom packages as a promise
atom.packages.requirePackages = (packages...) ->
new Promise (resolve, reject) ->
required = []
promises = []
failures = []
remains = packages.length
solved = ->
remains--
@abe33
abe33 / snippet.js
Last active August 29, 2015 14:08
Filter deprecated packages
atom.workspaceView
.find('.deprecation').hide()
.find('.list .list-item:not(:first-child)').hide()
.find('.stack-line-location[href*="<filter-expression>"]')
.parents('.list .list-item').show()
.parents('.deprecation').show()
@abe33
abe33 / without-proxy-subclassing.coffee
Last active August 29, 2015 14:06
ActiveRecord-like mixin
# Creates a collection class for the given model. This class
# will be decorated with the scopes defined on the model class.
build_collection_class = (model) ->
# The Collection class behaves mostly like an array except that
# every methods that should return an array return a collection
# instead.
class Collection
@model: model
# We can't use `new Collection` because Collection's instances