Skip to content

Instantly share code, notes, and snippets.

View jerel's full-sized avatar

Jerel Unruh jerel

View GitHub Profile
@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 "[email protected]"
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();
@jerel
jerel / Leaflet.LayerMixin
Last active January 2, 2016 12:18
A super lightweight way of adding and removing Leaflet markers for an Ember ArrayController. I'm currently using it and as it matures I may move it to a repo.
var Leaflet = Leaflet || {};
Leaflet.LayerMixin = Ember.Mixin.create({
layerSetup: function(options) {
var controller = options.controller
, add = options.add || 'addLayer'
, update = options.update || 'updateLayer'
, remove = options.remove || 'removeLayer'
, self = this;
controller.get('content').forEach(function(model, i) {
@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 / page.js
Last active November 27, 2019 23:24
Making the default Twitter tweet widgets work in an EmberJS application. This adds the twitter widget script after the tweets are in the DOM.
// Method 1
// add the twitter widget library to the bottom of app/index.html (after your Ember app)
<script src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
// initialize it after the content is in the DOM
import Ember from 'ember';
export default Ember.View.extend({
didInsertElement: function() {
window.twttr.widgets.load();