Skip to content

Instantly share code, notes, and snippets.

View BideoWego's full-sized avatar
:octocat:
Yarp

BideoWego BideoWego

:octocat:
Yarp
View GitHub Profile
@BideoWego
BideoWego / kitchen-sink.html
Last active February 28, 2020 09:42
HTML Kitchen Sink, all of the HTML elements in order for styling, testing, etc..
<h1>HTML Kitchen Sink</h1>
<h2>a</h2>
<a href="#">a</a>
<br>
<h2>abbr</h2>
<abbr title="abbr">Mr. Mrs. Dr.</abbr>
<br>
@BideoWego
BideoWego / Key Bindings - User
Last active February 17, 2016 19:39
My Sublime Text 3 Preferences
[
{ "keys": ["super+shift+w"], "command": "close_all" }
]
@BideoWego
BideoWego / folder.js
Created March 23, 2016 04:36
Small jQuery plugin to fold nested divs
// ----------------------------------------
// Folder jQuery plugin
// ----------------------------------------
// Usage:
//
// $('.folder.month').folder();
// $('.folder.year').folder({
// iconOpen: 'fa-folder-open',
// iconClosed: 'fa-folder'
// });
@BideoWego
BideoWego / JavaScript-Dos-and-Donts.js
Last active March 24, 2016 00:38
A list of JavaScript gotchas and best practices mostly dealing with the MVC and Module pattern
// --------------------------------------------------
// JavaScript Do's and Dont's
// --------------------------------------------------
//
// This is a list of gotchas and best practices
// mostly dealing with the MVC and Module pattern
//
@BideoWego
BideoWego / Pro.terminal.xml
Last active March 28, 2016 20:14
My Terminal Profile Preferences
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundBlur</key>
<real>0.0</real>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OV05TV2hpdGVcTlNDb2xvclNwYWNlViRjbGFzc00w
@BideoWego
BideoWego / FlashService.js
Last active April 7, 2016 06:44
Angular flash message alert service and directive with Rails style alert type names and a Bootstrap template
// ----------------------------------------
// FlashService
// ----------------------------------------
// Usage:
// 1. Inject FlashService into your controller
// 2. Bind to $scope
// $scope.flash = FlashService;
// or
// Use internally as FlashService
// 3. Use in your view or controller
@BideoWego
BideoWego / Searchable.rb
Last active July 9, 2018 07:13
Model Searchable concern for Rails
module Searchable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
@@searchable_fields = []
@@searchable_scope = nil
def search(q, method=nil)
@BideoWego
BideoWego / edge_list.rb
Created July 13, 2016 15:39
Create an edge list with weights
# Creates an Edge List of People
# e.g. [ [Person1, Person2, weight],
# [Person4, Person8, weight],
# ... ]
require 'pry-byebug'
Person = Struct.new(:id, :name)
NAMES = [
"Harry", "Sally", "Sam", "Michael", "Michelle", "Alok", "Dan", "Nick", "Olga", "Alice", "Joseph", "Donald", "Garrett", "Xin", "Mike", "Adam", "Peter", "Andur", "Tom", "Boris"
@BideoWego
BideoWego / assessment_js_ii_notes.md
Last active September 20, 2016 20:06
JS II Assessment Do's and Don'ts

assessment_js_ii_notes

Questions

  1. How can you include an init function in your module and why is it useful?
@BideoWego
BideoWego / flash_helper.js
Last active April 12, 2017 16:05
Express view helpers loader. Loads all modules in folder and registers all functions on every module under `Helpers.registered`
var FlashHelper = {};
FlashHelper.bootstrapAlertClassFor = function(key) {
return {
"error": "danger",
"alert": "danger",
"notice": "info"
}[key] || key;
};