Skip to content

Instantly share code, notes, and snippets.

View PereiraM's full-sized avatar

Michael Pereira PereiraM

View GitHub Profile
@PereiraM
PereiraM / gist:5af76559a4e5b08093a8
Created March 23, 2015 14:13
Media Queries - updated March 2015
/* iPad mini (portrait and landscape) ----------- */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 1) {
}
/* iPad 2 (portrait and landscape) ----------- */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
}
@PereiraM
PereiraM / README.md
Last active August 29, 2015 14:14 — forked from tnightingale/README.md
_.mixin({
// This will parse a delimited string into an array of
// arrays. The default delimiter is the comma, but this
// can be overriden in the second argument.
CSVtoArray: function( strData, strDelimiter ){
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = (strDelimiter || ",");
_.mixin({
// This will parse a delimited string into an array of
// arrays. The default delimiter is the comma, but this
// can be overriden in the second argument.
CSVtoJSON: function( strData, strDelimiter ){
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = (strDelimiter || ",");
// FIX: add an ending carriage return if missing
@PereiraM
PereiraM / gist:7eda71af8c2f3cd20346
Created January 9, 2015 16:45
ESI - device detect
<esi:assign name="touchoption" value="'(iPhone|iPod|Android|webOS|PlayBook)'"></esi:assign>
<esi:choose>
<esi:when test="$(HTTP_USER_AGENT) matches_i $(touchoption)">
<esi:text>
<!--#include virtual="mobile.html"-->
</esi:text>
</esi:when>
<script type="text/javascript">
var scRegion = 'NS';
console.log('scRegion: ' + scRegion);
function downloadJSAtOnload() {
console.log('Running downloadJSAtOnload');
var elementVendor = document.createElement("script");
var elementApp = document.createElement("script");
elementVendor.src = "/weathercenter/templates/default_site/weatherwidgets.group/js/stormcentre.vendor.min.js";
@PereiraM
PereiraM / gulpfile.js
Created January 8, 2015 03:33
Sample gulpfile.js
var gulpConfig = require('./package.json'),
src = 'src/',
dest = 'dist/',
deployPath = '~/Sites/cbc-ca/news2/interactives/' + gulpConfig.name;
var htmlFiles = [
src + 'index.html',
src + 'embed.html',
src + 'generator.html'
];
@PereiraM
PereiraM / package.json
Last active August 29, 2015 14:13
package.json for gulp
{
"name": "ProjectName",
"version": "1.0.0",
"description": "Project description",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "",
@PereiraM
PereiraM / bower.json
Created January 8, 2015 03:26
Sample bower file. Jquery, Handlebars, Underscore, Foundation.
{
"name": "projectName",
"version": "0.0.9",
"authors": [
"Michael Pereira"
],
"description": "Project description",
"main": "index.html",
"license": "MIT",
"ignore": [