Skip to content

Instantly share code, notes, and snippets.

@lot224
lot224 / _mixin_button.scss
Created September 6, 2012 12:50
A scss mixin for a button style.
@import "compass";
$button-radius: 4px !default;
@mixin button(
$base-color:#fff,
$size:small,
$radius:$button-radius
) {
@lot224
lot224 / _fizzbuzz.scss
Created September 7, 2012 23:19
FizzBuzz in SASS3
/*
http://en.wikipedia.org/wiki/Bizz_buzz
*/
$count: 100 !default;
@mixin fizzbuzz(
$count
) {
@for $i from 1 through $count {
@lot224
lot224 / Concatenate.cs
Created December 19, 2012 16:28
Microsoft Build Task to Concatenate/Compress/Obfuscate javascript files.
// Uses a port of the Yahoo YUI Compressor
// http://yuicompressor.codeplex.com/
using System;
using System.IO;
using System.Text;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;
using Yahoo.Yui.Compressor;
using System.Resources;
@lot224
lot224 / events.js
Created September 13, 2013 01:18
Simple Javascript Event Engine.
; (function (window, undefined) {
window.events = function (name) {
if (typeof name !== 'string')
return undefined;
name = name.toLowerCase();
if (!(window.events.collection[name] instanceof window.events.event))
window.events.collection[name] = new window.events.event(name);
@lot224
lot224 / concatenate.cs
Last active August 29, 2015 14:11
MS Build Tasks, concatenate, templates
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace eo {
public class Concatenate : Task {
@lot224
lot224 / extend.js
Created December 19, 2014 20:13
simple javascript extend function
var extend = function () {
if (arguments.length == 0)
return {};
if (arguments.length == 1)
return arguments[0];
var nResult = {};
for (var i = 0; i < arguments.length; i++) {
@lot224
lot224 / Horizontal.js
Last active September 9, 2015 03:04
Generate Hexagon Points
var horizontalHexagonPoints = function (canvas, radius) {
var size = {
width: radius * 2,
height: (radius / 2 * Math.sqrt(3)) * 2
};
var rows = Math.ceil(canvas.height / size.height) + 1;
var columns = Math.ceil(canvas.width / (radius / 2 * 3)) + 1;
{"feed":{"author":{"name":{"label":"iTunes Store"}, "uri":{"label":"http://www.apple.com/itunes/"}}, "entry":[
{"im:name":{"label":"Inside Out (2015)"}, "im:image":[
{"label":"http://is4.mzstatic.com/image/thumb/Video69/v4/f8/f4/16/f8f41613-6e2f-6ea3-2125-8eb02d5c029a/pr_source.lsr/60x60bb-85.jpg", "attributes":{"height":"60"}},
{"label":"http://is4.mzstatic.com/image/thumb/Video69/v4/f8/f4/16/f8f41613-6e2f-6ea3-2125-8eb02d5c029a/pr_source.lsr/60x60bb-85.jpg", "attributes":{"height":"60"}},
{"label":"http://is5.mzstatic.com/image/thumb/Video69/v4/f8/f4/16/f8f41613-6e2f-6ea3-2125-8eb02d5c029a/pr_source.lsr/170x170bb-85.jpg", "attributes":{"height":"170"}}], "summary":{"label":"Growing up can be a bumpy road, and it's no exception for Riley, who is uprooted from her Midwest life when her father starts a new job in San Francisco. Like all of us, Riley is guided by her emotions – Joy (Amy Poehler), Fear (Bill Hader), Anger (Lewis Black), Disgust (Mindy Kaling) and Sadness (Phyllis Smith). The emotions live in H
@lot224
lot224 / formControlDropDown.html
Created January 15, 2016 10:05
Bootstrap Form Control Dropdown Example
<div class="input-group">
<span class="input-group-addon">Label Name</span>
<div class="dropdown input-group" id="DropDownId">
<ul class="dropdown-menu" style="width:100%">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
@lot224
lot224 / prototype.js
Created April 15, 2016 15:29
javascript string.format like c# (ish)
if (!String.prototype.format) {
String.prototype.format = function () {
var n = this;
for (var i = 0; i < arguments.length; i++) {
var e = new RegExp('\\{' + (i) + '\\}', 'gm');
n = n.replace(e, arguments[i]);
}
return n;
}
}