Skip to content

Instantly share code, notes, and snippets.

View webuniverseio's full-sized avatar

Sergey Zarovskiy webuniverseio

View GitHub Profile
@webuniverseio
webuniverseio / app.build.js
Created December 6, 2012 19:23
requirejs build config - common module exclude
/*global require:true, console: true*/
var requirejs = require('requirejs'),
//...
config = {
//...
modules: [
{
name: 'app/core',
include: ['app/modules/app-flow', 'app/modules/font-resize']
},
@webuniverseio
webuniverseio / gist:6152282
Created August 4, 2013 22:49
Fix for iPad layout scales up when rotating from portrait to landcape
//<meta name="viewport" content="width=device-width, initial-scale=1">
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
var viewportmeta = document.querySelector('meta[name="viewport"]');
if (viewportmeta) {
viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';
document.body.addEventListener('gesturestart', function () {
viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6';
}, false);
}
@webuniverseio
webuniverseio / template.html
Created October 17, 2013 15:22
Stripped down version of my starting template
<!DOCTYPE HTML>
<!--[if lt IE 7]> <html lang="en-us" class="no-js lt-ie9 lt-ie8 lt-ie7 ie6"> <![endif]-->
<!--[if IE 7]> <html lang="en-us" class="no-js lt-ie9 lt-ie8 ie7"> <![endif]-->
<!--[if IE 8]> <html lang="en-us" class="no-js lt-ie9 ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta property="og:url" content="http://sitedomain/">
<meta property="og:title" content="Site">
<meta property="og:type" content="website">
@webuniverseio
webuniverseio / jshint.config.js
Last active January 1, 2016 13:08
jshint options
{
// To fix column positions for JSHint errors you may want to add `"indent": 1` to your
// **User** "jshint_options". This issue affects users with tabs for indentation.
// This fix was reverted due to a conflict with using the `"white": true` option.
// "indent": 1,
//Enforcing Options
"camelcase": true,
"curly": true,
"eqeqeq": true,
/*jshint strict:false*/
/*global require:true, console:true, __dirname:true*/
var path = require('path'),
exec = require('child_process').exec,
//developmentFilesPath - relative path from this file to source folder, don't add trailing splash
developmentFilesPath = '..',
watcher = require('watch-tree-maintained').watchTree(path.join(__dirname, developmentFilesPath), {
match : /\.(scss|js)$/g
});
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
// Ever wanted to know what would be the color operations to apply to a color
// in order to find a second color, just out of curiosity?
// Like, "how to programmatically go from #BADA55 to #B0BCA7"?
// --------------------------------------------------------------------------------
// @param (color) $a: first color
@webuniverseio
webuniverseio / sandbox.js
Created April 21, 2014 12:56
Sandbox interface
/*global _*/
(function () {
'use strict';
function Sandbox(props) {
}
Sandbox.prototype = {
constructor: Sandbox,
on: function (event, cb) {},
off: function (event) {},
@webuniverseio
webuniverseio / SassMeister-input-HTML.html
Created August 17, 2014 13:46
BEM (GRM) style modifiers
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<span class="a button a">WHOA</span>
<span class="a button--primary a">WHOA</span>
<span class="a button--primaryAlt a">WHOA</span>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noodp, noydir" />
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">
<link rel="canonical" href="http://mysite.com/" />
<link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" />
{
"type": "Program",
"start": 0,
"end": 160,
"range": [
0,
160
],
"body": [
{