Skip to content

Instantly share code, notes, and snippets.

View mihar's full-sized avatar
🤠
We the best

Miha mihar

🤠
We the best
  • Global
View GitHub Profile
@mihar
mihar / slurpah.js
Created May 22, 2016 00:50 — forked from jenbennings/slurpah.js
slurpah.js
(function(){
var externalStylesheets = [];
var fonts = {};
function findExternalStylesheets(obj, callback) {
sheet = document.styleSheets,
i = sheet.length,
rule = null;
while( 0 <= --i ) {
if (sheet[i].cssRules === null) {
@mihar
mihar / index.html
Created January 10, 2014 11:04 — forked from mdakram/index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!-- iframe used for attempting to load a custom protocol -->
<iframe style="display:none" height="0" width="0" id="loader"></iframe>
@mihar
mihar / magic.rb
Created December 14, 2009 15:55 — forked from mislav/magic.rb
require 'active_record'
class ActiveRecord::Base
def self.magic!
connection.tables.map { |table|
klass = Class.new(self)
Object.send(:const_set, table.singularize.camelize, klass)
}.each { |model|
model.column_names.grep(/_id$/).each { |foreign_key|
name = foreign_key.sub(/_id$/, '')