Skip to content

Instantly share code, notes, and snippets.

:octocat:
Working on personal projects

Joseph Rex josephrexme

:octocat:
Working on personal projects
Block or report user

Report or block josephrexme

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gulpfile.js
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'),
View new.html.erb
<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>
View active_data.js.coffee
do ($ = jQuery, exports = window) ->
class ActiveDataBinder
constructor: (uid) ->
# Use a jQuery object as simple PubSub
pubSub = $ {}
# We expect a 'data' attribute specifying the binding
@josephrexme
josephrexme / timezones.json
Created Nov 27, 2015
Timezones in JSON format
View timezones.json
[
{
"value": "Dateline Standard Time",
"abbr": "DST",
"offset": -12,
"isdst": false,
"text": "(UTC-12:00) International Date Line West"
},
{
"value": "UTC-11",
@josephrexme
josephrexme / countries.json
Created Nov 27, 2015
A proper JSON format of countries list
View countries.json
{
"AF": "Afghanistan",
"AX": "Åland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "AndorrA",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
@josephrexme
josephrexme / README.md
Last active Aug 29, 2015 — forked from necolas/README.md
Experimenting with component-based HTML/CSS naming and patterns
View README.md

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name
View parser.rb
def parse(self)
=begin
Method to parse the resource file for the terminal alias
provided, and populate the gw array with the terminal information.
Parameters
==========
None
Exceptions
==========
zipfile.BadZipfile - in case resource file cannot be read
View bijective.rb
# Simple bijective function
# Basically encodes any integer into a base(n) string,
# where n is ALPHABET.length.
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047
ALPHABET =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//)
# make your own alphabet using:
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join
@josephrexme
josephrexme / app.css
Created Jan 15, 2015
Specity graph for my jekyll blog CSS. This against http://jonassebastianohlsson.com/specificity-graph/
View app.css
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}/*! HTML5 Boilerplate v4.3.0 | MIT License | http://h5bp.com/ */html,button,input,select,textarea{color:#222}html{font-size:1em;line-height:1.4}::-mo
@josephrexme
josephrexme / file.rb
Created Jan 4, 2015
Attendance Logic
View file.rb
=begin
Help with Logic
=end
allRecords = Attendance.pluck(:date, :presence).map { |attendance, presence| [attendance.strftime('%B'), presence] } #=> [['November',true],['November',false],['November',true],['December', true], ['December', false], ['January',false], ['January',true]]
monthFilter = allRecords.uniq.map { |month| [month[0]] } #=> ['November','November', 'November', 'December', 'December', 'January','January']
months = monthFilter.uniq #=> ['November','December','January']
# Expected To do the following:
# To fetch all the records and count the number of true presence with false presence per month. Then get a percentage of true / total in each month
You can’t perform that action at this time.