Skip to content

Instantly share code, notes, and snippets.

Working on personal projects

Joseph Rex josephrexme

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
josephrexme / company.html.erb
Created Dec 24, 2014
Displaying various form create on a page
View company.html.erb
<section class="row-doubles">
<div class="title">Add Department</div>
<div class="content pad10">
<%= form_for @department, url: 'department_path' do |f| %>
<%= f.label :name, 'Department Name' %>
<%= f.text_field :name %>
josephrexme / company.html.erb
Last active Aug 29, 2015
Multiple CRUD operations on a page
View company.html.erb
<!-- Create -->
<%= form_for @department do |f| %>
<%= f.label :name, 'Department Name' %>
<%= f.text_field :name %>
<%= f.label :parent %>
<% department_array = { |department| [,] } %>
<%= :parent, options_for_select([['no parent', '']] + department_array) %>
josephrexme /
Created Dec 26, 2014
UJS: Continue execution of ajax request in a callback after altering with ajax:beforeSend
$(document).ready ->
$('[id^="edit_department"').on("ajax:success", (e, data, status, xhr) ->
$(this).append "<p class='fr'>Updated Succesfully</p>"
).on "ajax:error", (e, data, status, error) ->
$(this).append "<p class='fr'>Failed to update</p>"
$('.content>.fr span:last-of-type>a').on "ajax:beforeSend", (xhr, settings) ->
title: "Are you sure?"
josephrexme / _variables.scss.erb
Created Dec 28, 2014
Changing themes in an application
View _variables.scss.erb
// Variables
$hopbush: #c69;
$bouquet: #b37399;
$venus: #998099;
$patina: #699;
$nebula: #d2e1dd;
$wine: #B21F1F;
$dawn-pink: #f2ece4;
$wafer: #e1d7d2;
$skyblue: #9BC1F5;
josephrexme / DOM
Last active Aug 29, 2015
Form_for breaking on encounter of <td>
View DOM
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="ostrich-dev">
<link href=",300" rel="stylesheet" type="text/css">
<link rel="author" href="">
<link rel="shortcut icon" href="http://localhost:3000/favicon.ico">
<link data-turbolinks-track="true" href="/assets/application.css" media="all" rel="stylesheet">
josephrexme / file.rb
Created Jan 4, 2015
Attendance Logic
View file.rb
Help with Logic
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 = { |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
josephrexme / app.css
Created Jan 15, 2015
Specity graph for my jekyll blog CSS. This against
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 | */html,button,input,select,textarea{color:#222}html{font-size:1em;line-height:1.4}::-mo
View bijective.rb
# Simple bijective function
# Basically encodes any integer into a base(n) string,
# where n is ALPHABET.length.
# Based on pseudocode from
# make your own alphabet using:
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join
View parser.rb
def parse(self)
Method to parse the resource file for the terminal alias
provided, and populate the gw array with the terminal information.
zipfile.BadZipfile - in case resource file cannot be read
josephrexme /
Last active Aug 29, 2015 — forked from necolas/
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.


You can’t perform that action at this time.