Skip to content

Instantly share code, notes, and snippets.

@coltpini
coltpini / icon-generation
Last active August 29, 2015 14:12
ascii problem, icon generation
//Function that converts a base10 number to base16 number.
//This is needed to convert an index from a list to the appropriate hex value for unicode values.
@function decToHex($dec,$length)
$hexVals: "A","B","C","D","E","F"
$base: 16
$q: $dec
$result: ""
@while $q != 0
$mod: $q % $base
$q: floor($q / $base)
@coltpini
coltpini / index.html
Created December 8, 2012 04:31
A CodePen by Colt Pini. RegExpert - This is a regex tester. Javascript style. This shows the matches in an output window, and a .test() result. Also a small regex lookup. Basically I wanted my own little tool instead of dealing with other peoples. Most of them are written in languages other than JS so the regex isn't quite right.
<ul class="aside">
<li>
<span>flags:</span>
<div>
g<input type="checkbox" name="flags" value="g" />
i<input type="checkbox" name="flags" value="i" />
m<input type="checkbox" name="flags" value="m" />
y<input type="checkbox" name="flags" value="y" id="y" />
</div>
</li>
@coltpini
coltpini / index.html
Created December 8, 2012 05:06
A CodePen by Colt Pini. RegExpert - I wanted to build a JS app for regex testing. This works well. It is still in progress. But I am happy. Most other apps that I have seen have been built in other languages and didn't truely reflect the JS regex. This is in JS for JS so you don't have those problems. The output shows the matches, there is highl…
<ul class="aside">
<li>
<span>flags:</span>
<div>
g<input type="checkbox" name="flags" value="g" />
i<input type="checkbox" name="flags" value="i" />
m<input type="checkbox" name="flags" value="m" />
y<input type="checkbox" name="flags" value="y" id="y" />
</div>
</li>
@coltpini
coltpini / iop-stage1.js
Last active August 1, 2016 01:08
First stage of my interesting object pattern
let MyObj = {
init(){
let myObj = {};
return myObj;
}
}
@coltpini
coltpini / iop-stage3.js
Created August 1, 2016 01:21
Stage 3 of interesting object pattern
let myObj = MyObj.init({option1:"billy"});
//My obj is now an instance.
myObj.myFunction();
// Hi there, billy!!
let myObj2 = MyObj.init({option1:"jimmy"});
// another instance of MyObj.
myObj2.myFunction();
// Hi there, jimmy!!
@coltpini
coltpini / iop-stage2.js
Last active August 1, 2016 01:24
Second stage
let MyObj = {
init(name){
let myObj = {};
myObj.myFunction = (){ MyObj.myFunction(name)};
return myObj;
},
myFunction(name){
console.log(`Hi there, ${name}!!`);
@coltpini
coltpini / iop-stage4.js
Last active August 1, 2016 04:27
inheritance in interesting object pattern
let MyObj = {
init(name){
let myObj = {};
myObj.greet = function(){MyObj.greet(name)};
myObj.depart = function(){MyObj.depart(name)};
return myObj;
},
greet(name){
console.log(`Hi there, ${name}!!`);
},
.exampleElement {
width: grid-column(6,600);
margin-left: grid-gutter(2,600);
}
$grid__column-width: (
'300': $grid__column-width--300,
'400': $grid__column-width--400,
'500': $grid__column-width--500,
'600': $grid__column-width--600,
'700': $grid__column-width--700
);
$grid__gutter-width: (
'300': $grid__gutter-width--300,
// column-numbers
$grid__column-number--300: 4;
$grid__column-number--400: 12;
$grid__column-number--500: 12;
$grid__column-number--600: 12;
$grid__column-number--700: 16;
// column-widths
$grid__column-width--300: $grid__width--300 / $grid__column-number--300;
$grid__column-width--400: $grid__width--400 / $grid__column-number--400;