Skip to content

Instantly share code, notes, and snippets.

View matthisamoto's full-sized avatar

Matt Hisamoto matthisamoto

  • Savas Labs
  • Milwaukee, WI
View GitHub Profile
@matthisamoto
matthisamoto / sample.css
Created July 15, 2016 03:20
Identify Bootstrap classes in CSS to apply to all pulled elements e.g. "pull-xs-left", "pull-md-right"
&[class*="pull"] {
&[class*="left"] {
margin-right: 20px;
}
&[class*="right"] {
margin-left: 20px;
}
}
@matthisamoto
matthisamoto / application.html.erb
Last active May 4, 2016 21:06 — forked from suryart/application.html.erb
Rails 4 flash messages using Twitter Bootstrap(bootstrap-sass: https://github.com/thomas-mcdonald/bootstrap-sass). An improved version of https://gist.github.com/roberto/3344628
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@matthisamoto
matthisamoto / draw-svg-arrows-php
Last active August 29, 2015 14:07
Draw SVG Arrows with PHP
function drawSVGArrow($width, $height, $direction = "right") {
switch ($direction) {
case "right":
$points = array(
"0, 0",
$width.", ".floor($width/2),
"0, ".$width
);
@matthisamoto
matthisamoto / loadFonts
Created May 30, 2014 17:21
loadFonts - a sort-of hacky way to check if fonts have loaded
/*
loadFonts - a sort-of hacky way to check if fonts have loaded
"Forked" from this: http://stackoverflow.com/a/11689060
*/
function loadFonts (fonts, callback) {
var loadedFonts = 0, fontList = [], interval;
for(var i = 0, l = fonts.length; i < l; ++i) {
(function(font) {
var node = document.createElement('span');
<section class="row">
<div class="block">
<div class="front">
<div class="contain">
<p>F</p>
</div>
</div>
<div class="back">
<div class="contain">
<p>is for<br>Feynman</p>
@matthisamoto
matthisamoto / get-rank.sql
Created July 18, 2012 19:48
get rank of item in table MySQL
SET @rownum := 0;
SELECT rank FROM (SELECT @rownum := @rownum + 1 AS rank, id, complete FROM users WHERE complete=1 ORDER BY created_at) as result WHERE id=27;
@matthisamoto
matthisamoto / doc-ready.js
Created June 27, 2012 15:53
My document.ready function of choice for jQuery
(function($) {
}(jQuery));
@matthisamoto
matthisamoto / gist:1507455
Created December 21, 2011 20:00
Get Class Definition of Object
function getClass(obj:Object):Class
{
return Class( getDefinitionByName( getQualifiedClassName(obj) ) );
}