Skip to content

Instantly share code, notes, and snippets.

@abe33
abe33 / haml_embedded_languages.xml
Last active August 29, 2015 13:56
Enable color highlighting of Ruby, JavaScript, CoffeeScript and Sass source code within haml files in SublimeText
<!--
Add the code below into your 'Ruby Haml.tmLanguage' file.
The file should be located in your sublime packages path.
If you don't have one, take the 'Ruby.sublime-package' file
from the 'Installed Packages' directory, change the file extension
to zip and extract it into your 'Packages' directory.
Edit: The previous version failed to match all the cases with a single begin/end pair.
This version uses two rules instead of one. One for embedded language that starts without
@abe33
abe33 / agnoster-abe.zsh-theme
Created May 21, 2014 14:38
Custom Agnoster Theme
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
#
Firefox:
navigator.appCodeName : Mozilla
navigator.vendor: ""
navigator.product: Gecko
Safari:
navigator.appCodeName : Mozilla
navigator.vendor: Apple Computer, Inc.
navigator.product: Gecko
@abe33
abe33 / npm-debug.log
Created July 8, 2014 08:20
Git-log install error
0 info it worked if it ends with ok
1 verbose cli [ '/Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/bin/node',
1 verbose cli '/Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/node_modules/npm/bin/npm-cli.js',
1 verbose cli '--globalconfig',
1 verbose cli '/Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/.apmrc',
1 verbose cli '--userconfig',
1 verbose cli '/Users/cedric/.atom/.apmrc',
1 verbose cli 'install',
1 verbose cli '--target=0.11.10',
1 verbose cli '--arch=x64' ]
@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
@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 / 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 / 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 / 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 / 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', '*')