Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Florence kflorence

  • Solar Mosaic, Inc.
  • Austin, Texas
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am kflorence on github.
  • I am kflo (https://keybase.io/kflo) on keybase.
  • I have a public key whose fingerprint is 79E4 56F4 4594 3E67 C69A AFB7 A371 9CEE B95E D236

To claim this, I am signing this object:

@kflorence
kflorence / scrollbarWidth.js
Created Jul 10, 2012
Calculate scroll bar width cross-browser
View scrollbarWidth.js
function getScrollBarWidth() {
var inner = document.createElement('p');
inner.style.width = "100%";
inner.style.height = "200px";
var outer = document.createElement('div');
outer.style.position = "absolute";
outer.style.top = "0px";
outer.style.left = "0px";
outer.style.visibility = "hidden";
@kflorence
kflorence / .gitconfig
Last active Apr 26, 2018
Useful config settings
View .gitconfig
[alias]
br = branch
ci = commit
cl = clone
co = checkout
cp = cherry-pick
df = diff
lg = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
mg = merge --no-ff
pl = pull --rebase
@kflorence
kflorence / cart-mysql.sql
Last active Oct 26, 2017
sample mysql interview questions
View cart-mysql.sql
drop table if exists customer;
create table customer(
id int auto_increment primary key,
first_name varchar(96) not null,
last_name varchar(96) not null,
address_id int not null
);
insert into customer (first_name, last_name, address_id) values ('john', 'doe', 1);
insert into customer (first_name, last_name, address_id) values ('jane', 'doe', 2);
@kflorence
kflorence / Conversions.scala
Created Dec 30, 2015
spring conversion helpers for scala
View Conversions.scala
package com.solarmosaic.core.service.converter
import javax.inject.Inject
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.core.convert.{TypeDescriptor, ConversionService}
import scala.reflect._
/**
View jquery.ba-floatingscrollbar.js
/*!
* jQuery Floating Scrollbar - v0.5 - 09/05/2013
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($, window){
@kflorence
kflorence / .jshintrc
Created Aug 22, 2013
Wikia .jshintrc
View .jshintrc
{
// Wikia .jshintrc
// Enforcing
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
@kflorence
kflorence / empx.js
Last active Dec 16, 2015
Convert from em to px and vice versa.
View empx.js
function unit( scope ) {
return parseInt( window.getComputedStyle( scope || document.body ).fontSize, 10 );
}
function pxToEm( px, scope ) {
return ( parseInt( px, 10 ) / unit( scope ) ).toFixed( 8 ) + 'em';
}
function emToPx( em, scope ) {
return Math.round( parseFloat( em ) * unit( scope ) ) + 'px';
View update-config.sh
# Put this in ~/.bash_profile on your devbox
# Run it like: $ update-config
function update-config {
echo "Updating config..."
cd /usr/wikia/docroot
git pull --rebase
mkdir -p wiki.factory
ln -sf /usr/wikia/source/wiki/extensions/wikia/Development/Configs_DevBox/LocalSettings.php wiki.factory/LocalSettings.php
perl /usr/wikia/docroot/clinks.pl --source=/usr/wikia/source/wiki --docroot=/usr/wikia/docroot/wiki.factory
@kflorence
kflorence / join.js
Created Jan 1, 2013
Simple function for joining non-Array object properties
View join.js
// join( { one: "one", two: "two" } );
// => "one,two"
function join( obj, separator ) {
var k,
items = [];
if ( typeof obj.join === "function" ) {
items = obj;
} else {