Skip to content

Instantly share code, notes, and snippets.

@d4rkie
d4rkie / ioc.md
Last active August 29, 2015 13:57

Dependency Injections

依存性の注入

???

Dependency injection is a software design pattern that allows the removal of hard-coded dependencies and makes it possible to change them, whether at run-time or compile-time.

http://p.tl/2tgA <-- japanese wiki page

@d4rkie
d4rkie / unminify.rb
Last active August 29, 2015 13:57
simple method to "prettify" compressed CSS. useful with compass in config.rb
def unminify(filename)
raise "file not found #{filename}" unless File.exists? filename
text = []
File.open(filename, 'r:UTF-8') do |f|
f.each_line do |line|
line.strip!
code = line
.split("\t").join(" ")
.gsub(/\s*{\s*/i, " {\n ")
@d4rkie
d4rkie / config.rb
Created March 21, 2014 08:19
compass config. emulates a 5th output style I'd call "optimize"
# Require any additional compass plugins here.
if Sass::VERSION =~ /3.1/
raise "you should upgrade to Sass version 3.2"
end
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "/css"
sass_dir = "/scss"
<?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">
<array>
<dict>
<key>Properties</key>
<dict>
<key>DRCDTextCFStringEncodingKey</key>
<integer>66049</integer>
<key>DRCDTextCharacterCodeKey</key>
@d4rkie
d4rkie / mb.paste-a-date.user.js
Last active February 8, 2018 13:38
MusicBrainz: Paste-A-Date! (fixed for the new Relationship Editor)
// ==UserScript==
// @name MusicBrainz: Paste-A-Date!
// @description This script adds a field after the existing date fields where you can paste a date and it will try to parse it.
// @version 2015-01-13
// @author nikki, d4rkie
//
// @grant none
// @include *://musicbrainz.org/*
// @include *://beta.musicbrainz.org/*
// @include *://test.musicbrainz.org/*