Skip to content

Instantly share code, notes, and snippets.

View hauntedhost's full-sized avatar
💭
👻

Jules Omlor hauntedhost

💭
👻
View GitHub Profile
@hauntedhost
hauntedhost / target-fade.css
Created November 14, 2014 21:00
slowly fade out background color
.target-fade {
-webkit-animation: target-fade 10s 1;
-moz-animation: target-fade 10s 1;
}
@-webkit-keyframes target-fade {
0% { background-color: rgba(80, 173, 118, .1); }
100% { background-color: rgba(80, 173, 118, 0); }
}
@hauntedhost
hauntedhost / postgresql.conf
Created October 14, 2014 18:06
/Library/Application Support/Postgres/var-9.3/postgresql.conf
shared_buffers = 3GB # 30% of total system RAM
work_mem = 5MB
maintenance_work_mem = 64MB
fsync = off
synchronous_commit = off
full_page_writes = off
checkpoint_segments = 100
checkpoint_timeout = 45min
effective_cache_size = 6GB # twice shared_buffers
@hauntedhost
hauntedhost / Preferences.sublime-settings
Created September 25, 2014 19:05
Sublime preferences
{
"detect_indentation": false,
"draw_white_space": "all",
"font_size": 17.0,
"indent_to_bracket": true,
"rulers":
[
80
],
"show_full_path": true,
@hauntedhost
hauntedhost / hookup_container_example.js
Created September 9, 2014 22:36
Ember.js HookupContainer mixin
// mixins/hookup_container.js
App.HookupContainer = Ember.Mixin.create({
// https://github.com/tehviking/giffindor/issues/1#issuecomment-51066764
hookupContainer: function() {
this.container = SoftLacrosse.__container__;
}.on('init'),
});
// components/my_component.js
App.MyComponent = Ember.Component.extend(
@hauntedhost
hauntedhost / mnemonic-wordlist.txt
Created July 9, 2014 18:06
mnemonic wordlist, for naming servers, services, etc, etc.
Wordlist ver 0.732 - EXPECT INCOMPATIBLE CHANGES;
acrobat africa alaska albert albino album
alcohol alex alpha amadeus amanda amazon
america analog animal antenna antonio apollo
april aroma artist aspirin athlete atlas
banana bandit banjo bikini bingo bonus
camera canada carbon casino catalog cinema
citizen cobra comet compact complex context
credit critic crystal culture david delta
dialog diploma doctor domino dragon drama
{
"detect_indentation": false,
"draw_white_space": "all",
"font_size": 17.0,
"ignored_packages":
[
"Vintage",
"Handlebars",
"ColorPick"
],
require 'benchmark'
require 'set'
def ordered_vowel_words_regex(words)
valid_words = []
words.split(" ").each do |word|
vowels = word.scan(/[aeiou]/)
valid_words << word if vowels == vowels.sort
end
valid_words.join(" ")
// Complete the solution so that it splits the string into pairs of two characters. If the string contains an odd number of characters then it should replace the missing second character of the final pair with an underscore ('_').
// Examples:
// solution('abc') // should return ['ab', 'c_']
// solution('abcdef') // should return ['ab', 'cd', 'ef']
function paddedPairs(str) {
var pairs = [''];
for (var i = 0; i < str.length; i++) {
require 'rspec'
def ordered_vowel_words(words)
words.split(" ").inject([]) do |valid_words, word|
vowels = word.scan(/[aeiou]/)
valid_words.tap { |w| w << word if vowels == vowels.sort }
end.join(" ")
end
describe "#ordered_vowel_words" do
jQuery.noConflict();
(function ($) {
// your code in here can safely use $ for jQuery
})(jQuery);
// code using $ for another library