Skip to content

Instantly share code, notes, and snippets.

View josephrexme's full-sized avatar
:octocat:
Training wolves and dragons

Joseph Rex josephrexme

:octocat:
Training wolves and dragons
View GitHub Profile
@josephrexme
josephrexme / svgdefs.svg
Created February 2, 2018 22:35
Example SVG sprite
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am josephrexme on github.
  • I am josephrexme (https://keybase.io/josephrexme) on keybase.
  • I have a public key ASBa0d3rxEv4t-TsMIGRPL5ZZGKgpq0G0Q2c2PkSrZe1Ego

To claim this, I am signing this object:

@josephrexme
josephrexme / gulpfile.js
Created March 3, 2016 18:54
Example gulpfile
var gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
gutil = require('gulp-util'),
uglify = require('gulp-uglify'),
postcss = require('gulp-postcss'),
nano = require('gulp-cssnano'),
concatCss = require('gulp-concat-css'),
autoprefixer = require('autoprefixer'),
sourcemaps = require('gulp-sourcemaps'),
@josephrexme
josephrexme / dabblet.css
Created February 16, 2017 19:43
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
/*
.row{
}
.row::before, .row::after{
content: ' ';
display: table;
}
@josephrexme
josephrexme / rspec_rails_cheetsheet.rb
Created September 3, 2016 12:57 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@josephrexme
josephrexme / fizzbuzz.sql
Created August 22, 2016 00:53
Fizzbuzz in postgresql
select generate_series as num,
case when generate_series % 15 = 0
then 'fizzbuzz'
when generate_series % 3 = 0
then 'fizz'
when generate_series % 5 = 0
then 'buzz'
else '' end
as fizzbuzz
from generate_series(1, 100);
@josephrexme
josephrexme / introrx.md
Created May 18, 2016 14:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Category extends Model{
public function subcategories(){
return this->hasMany('App\Subcategory')
}
}
<div class="col-md-8 col-md-offset-1">
<div class="panel panel-default">
<%= form_for(@weekly_performance_review) do |f| %>
<% if @weekly_performance_review.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@weekly_performance_review.errors.count, "error") %> prohibited this weekly_performance_review from being saved:</h2>
<ul>
<% @weekly_performance_review.errors.full_messages.each do |message| %>
<li><%= message %></li>
@josephrexme
josephrexme / active_data.js.coffee
Created January 29, 2016 09:17 — forked from stephanschubert/active_data.js.coffee
Simple two-way data binding
do ($ = jQuery, exports = window) ->
class ActiveDataBinder
constructor: (uid) ->
# Use a jQuery object as simple PubSub
pubSub = $ {}
# We expect a 'data' attribute specifying the binding