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
-webkit-touch-callout: none; | |
-webkit-user-select: none; | |
-khtml-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; |
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() { | |
$('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html,body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
return false; |
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
browser-sync start --server --directory true --files "**/*.css, **/*.js, **/*.html" |
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
// Register keyboard events | |
$(document).keydown(function(e) { | |
if (e.keyCode === 37) { | |
// Previous | |
$(".carousel-control.left").click(); | |
return false; | |
} | |
if (e.keyCode === 39) { | |
// Next | |
$(".carousel-control.right").click(); |
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
// set-up a connection between the client and the server | |
var socket = io.connect(); | |
// let's assume that the client page, once rendered, knows what room it wants to join | |
var room = "abc123"; | |
socket.on('connect', function() { | |
// Connected, let's sign-up for to receive messages for this room | |
socket.emit('room', room); | |
}); |
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
//Resize to Width Height | |
ffmpeg -i input.mp4 -s WxH -qscale 0 -vcodec mpeg4 output.mp4 | |
//Compress the output file | |
ffmpeg -i output.mp4 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -vcodec h264 -acodec mp2 output-final.mp4 |
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
browserName: 'chrome', | |
chromeOptions: { | |
binary: '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome', | |
args: [ | |
'headless', | |
// Use --disable-gpu to avoid an error from a missing Mesa | |
// library, as per | |
// https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md | |
'disable-gpu', | |
] |
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
code --list-extensions | xargs -L 1 echo code --install-extension |
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
ref.orderByChild('key').equalTo('something').once('value') | |
.then(function (snap) { | |
snap.forEach(function (snap) { | |
if (item.key === '-LTRAB3DKkK4FC765') { | |
snap.remove(); | |
} | |
}); | |
}); |
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
//Importing the db structure for default apps | |
var appModels = ['User', 'AccessToken', 'ACL', 'RoleMapping', 'Role']; | |
var ds = app.dataSources.postgres; | |
ds.isActual(appModels, function (err, actual) { | |
if (!actual) { | |
ds.autoupdate(appModels, function (err) { | |
if (err) throw (err); | |
}); | |
} |
OlderNewer