This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $bgImages = $('.background-image'); | |
var loadCount = 0; | |
$bgImages.each(function (index) { | |
// Get source based on size | |
var src = isMobile() ? $(this).attr('data-mobile') : $(this).attr('data-desktop') ; | |
// Set source | |
this.src = src; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example HTML: | |
// <img class="background-image" src="images/mobile/everydaycare.jpg"> | |
// Description: Serve mobile image first, and swap directory if page is desktop | |
function swapImageMobileFirst() { | |
var $bgImages = $('img.background-image'); | |
var loadCount = 0; | |
$bgImages.each(function(){ | |
// Get image src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.isElectron = false; | |
if (Meteor.isClient) { | |
Meteor.isElectron = (typeof window.require !== 'undefined'); | |
} | |
if (Meteor.isElectron) { | |
console.log("Running on desktop"); | |
var ipc = window.require('ipc'); | |
Template.hello.events({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var watch = require('gulp-watch'); | |
var shell = require('gulp-shell'); | |
// reload task | |
gulp.task('reload', shell.task([ | |
'echo hello' // do your shell commands here - works as an array of commands if you want to add more | |
])); | |
// watch files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var colors = []; | |
for (var i = 0, temp; i < 40; i++) { | |
colors.push("hsl(" + (i * 360 / 40) + ", 100%, 50%)"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var remote = nodeRequire('remote'); | |
var fs = remote.require('fs'); | |
// Get date time | |
var now = new Date(); | |
// Create file name based on date | |
var fileName = now.getFullYear() + '-' + now.getMonth() + '-' + now.getDay() + '-at-' + now.getHours() + '-' + now.getMinutes() + '-' + now.getSeconds() + '-tasting.json'; | |
// Write data into the json folder | |
fs.writeFile('HARDCODE-TASTING-DATE-DIR-HERE' + '/' + fileName, data, function (err) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isClient) { | |
Meteor.startup(function () { | |
scene = new THREE.Scene(); | |
camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 ); | |
renderer = new THREE.WebGLRenderer(); | |
renderer.setSize( window.innerWidth, window.innerHeight ); | |
document.body.appendChild( renderer.domElement ); | |
geometry = new THREE.BoxGeometry( 1, 1, 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mainWindow = new BrowserWindow({ | |
width: size.width < 1600 ? size.width - 50: size.width - 100, | |
height: size.width < 1600 ? size.height - 50: size.height - 100, | |
title: 'Hive: Home for busy teams', | |
/** | |
* Disable Electron's Node integration so that browser dependencies like `moment` will load themselves | |
* like normal i.e. into the window rather than into modules, and also to prevent untrusted client | |
* code from having access to the process and file system: | |
* - https://github.com/atom/electron/issues/254 | |
* - https://github.com/atom/electron/issues/1753 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(win,doc,root) { | |
var elusiveToUsers = /user/.test(root.elusive), | |
elusiveToAdmins = /admin/.test(root.elusive), | |
dataLoaded, | |
urlOptions = { host: win.location.hostname}; | |
root.location || (root.location = win.location.href.toString()); | |
if(root.root || elusiveToUsers) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dns = require('dns'); | |
setInterval(() => { | |
dns.resolve('hive.com', (error) => { | |
if (error) console.log(error); | |
else console.log('Connected!'); | |
}); | |
}, 1000); |
OlderNewer