Skip to content

Instantly share code, notes, and snippets.

View jerel's full-sized avatar

Jerel Unruh jerel

View GitHub Profile
@jerel
jerel / loading-slider.js
Created June 27, 2014 16:46
A loading animation for EmberJS that is similar to the Youtube animation. A bar shoots across the top of the viewport from left to right.
// CSS
div.loading-slider {
overflow: hidden;
height: 2px;
span {
float: left;
height: 2px;
background-color: red;
}
@jerel
jerel / bower.json
Last active August 29, 2015 14:05
Try the new Ember Canary version (without <script> metamorph tags).
{
"name": "app",
"dependencies": {
... snip ...
"ember": "263938523149963c89cf3bec9199bdd9fed728ed"
},
"resolutions": {
"ember": "263938523149963c89cf3bec9199bdd9fed728ed"
}
}
@jerel
jerel / controllers-post.js
Last active August 29, 2015 14:05
Ember 1.7 comment pagination example extracted from a working app
import Ember from 'ember';
export default Ember.ObjectController.extend({
queryParams: ['page'],
page: 1,
comments: Ember.K(),
paginationObserver: function() {
var id = this.get('id'),
page = this.get('page'),
@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
@jerel
jerel / elixir.exs
Last active October 5, 2015 18:30
This is a rough list of things that might initially be confusing to a non-rubyist trying to learn Elixir
# implicit return is fairly obvious but foreign to most languages
def foo(arg) do
arg
end
# foo/2 is the notation for a function that takes two arguments
# optional parenthesis
def foo arg, arg2 do
@jerel
jerel / gist:4057007
Created November 12, 2012 01:05
One liner to create self signed ssl cert
$ mkdir ssl
$ cd ssl
$ openssl genrsa -out server.key 2048 && openssl req -new -key server.key -out server.csr && openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
// founded it posted in the comment section of some guy's blog
@jerel
jerel / Guardfile
Created March 27, 2013 15:26
Watch for changes using guard and run corresponding test
guard 'phpunit', :tests_path => 'tests', :cli => '--colors --bootstrap tests/bootstrap.php --strict --debug --verbose' do
# Watch test files
watch(%r{^.+Test\.php$})
# Watch library files and run their tests
watch(%r{^core/(.+)\.php}) { |m| "tests/core/#{m[1]}_Test.php" }
end
@jerel
jerel / EmberJS-resources.md
Last active December 20, 2015 13:19
A compilation of links about EmberJS that may help you decide why you should or should not use it for your projects.
I put this together while exploring EmberJS for myself to see if it was a good fit. If anybody reads this and would like to add links to it please do. Just make sure it's a resource that is up-to-date and point out what about it you liked. Newest ones are added to the top.

July 2013

June 2013

@jerel
jerel / Dockerfile
Created October 23, 2013 19:42
A docker file to set up a simple ElastcSearch node.
# jerel/elasticsearch
#
# version 1.0
FROM ubuntu:precise
MAINTAINER Jerel Unruh "hello@jerel.co"
RUN sed 's/main$/main universe/' -i /etc/apt/sources.list && apt-get update
RUN apt-get -y install wget openjdk-7-jre-headless && cd /tmp
@jerel
jerel / check.php
Created December 13, 2013 16:35
Scan a Wordpress install for injected code. (And no I don't run Wordpress... this is for a friend)
<?php $start = microtime();
// increase memory limit
ini_set('memory_limit', '128M');
// no time limit
set_time_limit(0);
$affected_files = array();