Skip to content

Instantly share code, notes, and snippets.

@samselikoff
samselikoff / component.js
Created May 3, 2019 13:16
First pass at a LoadRecords component
import Component from '@ember/component';
import { task } from 'ember-concurrency';
import { inject as service } from '@ember/service';
export default Component.extend({
tagName: '',
store: service(),
@webdestroya
webdestroya / postgres.md
Last active May 23, 2023 04:54
Postgres commands for debugging

Process List

SELECT (NOW() - query_start) as duration, pid, usename, application_name, client_addr, client_port, backend_start, query_start,
wait_event, wait_event_type, state, query
FROM pg_stat_activity 
WHERE pid <> pg_backend_pid()
AND state <> 'idle'
ORDER BY query_start ASC;
@fredriks
fredriks / README.md
Last active September 17, 2016 01:40
bbcrd/audiowaveform with statically linked libsndfile and libmad
@jerel
jerel / clear.sh
Created April 13, 2015 19:13
Bash script to clear watchman roots to solve Error: watch EMFILE
watchman watch-list | tr -d '[:space:]' | grep -Po '(?<="roots":\[).*?(?=\])' | grep -Po '(?<=").*?(?="?,)' | while read path; do watchman watch-del "$path"; done
@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

class RedisController < ApplicationController
private
def render_from_redis(prefix, variation = nil)
manifest_id = params[:manifest_id]
if manifest_id.blank?
current_manifest_key = if variation
"#{prefix}:#{variation}:current"
else
"#{prefix}:current"
@lordhumunguz
lordhumunguz / Sample_Gruntfile.coffee
Last active August 29, 2015 14:02
A sample grunt file for {blog url}
module.exports = (grunt) ->
timestamp = Date.now().toString()
grunt.initConfig
env: grunt.file.readJSON '.env.json'
s3:
options:
key: '<%= env.AWS.AccessKeyId %>'
secret: '<%= env.AWS.SecretKey %>'
@knomedia
knomedia / ember_cli_rails.rake
Last active August 29, 2015 14:00
ember_cli_rails initial thoughts (see: https://github.com/knomedia/ember-cli-rails for a more complete solution)
require 'nokogiri'
namespace :ember_cli_rails do
desc "compile ember and update application.html.erb with ENV vars"
task :build => [:ember, :update_env] do
end
desc 'Build ember app and copies css and js files to rails'
class CsrfController < ApplicationController
def index
render json: { request_forgery_protection_token => form_authenticity_token }.to_json
end
end
@jgwhite
jgwhite / example.js
Last active January 13, 2016 15:04
Ember-cli Initializer Example
// app/initializers/csrf.js
export default {
name: 'csrf',
initialize: function(container, app) {
app.inject('route', 'csrf', 'service:csrf');
app.inject('controller', 'csrf', 'service:csrf');
}
}