Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
jehoshua02 / Preferences.sublime-settings
Last active August 29, 2015 14:09
My Sublime Config.
{
"binary_file_patterns": [
"bower_components/*",
"node_modules/*",
"build/*",
"dist/*"
],
"color_scheme": "Packages/User/Github.tmTheme",
"default_font_size": 12.0,
"detect_indentation": true,
@jehoshua02
jehoshua02 / sass_folders.md
Created November 14, 2014 00:19
Sass folder structure
  • scss
    • settings
      • colors.scss
      • variables.scss
    • tools
      • mixins.scss
      • functions.scss
    • generics
      • normalize.scss
  • box-sizing.scss
@jehoshua02
jehoshua02 / xcrun_simctl_list.md
Created October 14, 2014 15:39
Output from `xcrun simctl list`
$ xcrun simctl list
== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
$('.dummy-content[data-fill]').each(function (index, element) {
var $element = $(element);
var fill = $element.data('fill');
for (var i = 0; i < fill; i++) {
$element.append('<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus congue porta felis non fringilla. Etiam nisl turpis, volutpat ut ipsum id, semper ornare velit. Aliquam non lectus rhoncus, laoreet nisl eget, elementum nisi. Nullam diam ligula, faucibus quis orci rhoncus, blandit facilisis odio. Curabitur iaculis convallis felis ut iaculis. Etiam ut orci ullamcorper ligula elementum elementum vel at odio. Pellentesque feugiat lorem leo, non interdum nisl tristique nec. Suspendisse iaculis urna non convallis.</p>');
}
if ($element.is('[data-fin]')) {
$element.append('<p><a href="http://cdn.ebaumsworld.com/mediaFiles/picture/664379/80470643.gif">Fin</a></p>');
}
});
@jehoshua02
jehoshua02 / z-index.md
Last active August 29, 2015 14:06
Standardizable rules for z-index values.
z-index Element
500 Flash Messages
401 Modal
400 Modal Overlay
300 Menu
200 Header
100 Content Overlay
0-99 Content
@jehoshua02
jehoshua02 / styleSupported.js
Created September 5, 2014 01:04
Check if a style property is supported.
var styleSupported = (function () {
var supported = [];
var check = function (property) {
var body = document.body || document.documentElement;
var style = body.style;
// check for standard
if (typeof style[property] == 'string') { return true; }
@jehoshua02
jehoshua02 / scrollCap.js
Last active August 29, 2015 14:05
Prevent over-scroll, scroll freeze, scroll "bounce", or whatever you call it, on Safari Mobile.
var scrollCap = function ($element) {
$element.on('touchstart.scroll-cap', function(event){
var $element = $(this);
var scrollTop = $element.scrollTop();
var contentHeight = $element.get(0).scrollHeight;
var minScrollTop = 1;
var maxScrollTop = contentHeight - $element.height() - 1;
if(scrollTop < minScrollTop){
$element.scrollTop(minScrollTop);
@jehoshua02
jehoshua02 / jsonblock_example.js
Last active August 29, 2015 14:05
Example of using json for docblocks
Reusables.Breakpoints.Breakpoint.prototype.jsondoc = {
name: 'Breakpoint',
namespace: 'Reusables.Breakpoints',
type: 'Class',
description: 'Represents a breakpoint on a set of elements.',
params: [
{
name: '$elements',
description: 'Represents set of elements for this breakpoint.',
types: [
@jehoshua02
jehoshua02 / browser_check.sh
Last active August 29, 2015 14:05
Check a url in all browsers!
#!/bin/bash
URL=
FIREFOX=false
CHROME=false
SAFARI=false
IE10=false
IE11=false
IE8=false