Skip to content

Instantly share code, notes, and snippets.

View etoxin's full-sized avatar

Adam Lusted etoxin

View GitHub Profile
@etoxin
etoxin / javascript.json
Last active January 25, 2017 00:11
Visual Studio Code User Snippets and Other Settings
{
"Print to console": {
"prefix": "l",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
},
"Simple function":{
@etoxin
etoxin / helpers.js
Last active February 20, 2017 05:55
Handlebars KeystoneJS Debug helper
/**
* Handlebars KeystoneJS Debug helper
* @param optionalValue
*/
_helpers.debug = function(optionalValue) {
console.log("Current Context");
console.log("====================");
console.log(this);
if (optionalValue) {
@etoxin
etoxin / object.create.js
Last active May 14, 2018 21:00
Sharing between Objects
var Vehicle = {
describe: function () {
return `This ${this.type} is the ${this.make} ${this.model}.`;
}
}
var Car = Object.create(Vehicle, {
type: {value: 'Car', writable: true}
});
window.addEventListener("deviceorientation", function (e) {
var all = document.querySelectorAll('*');
for(var i = 0;i < all.length;i++) {
all[i].style.transform = 'rotateX('+e.alpha+'deg) rotateY('+e.gamma+'deg) rotateX('+e.beta+'deg)';
}
}, true);
@etoxin
etoxin / kitchenSink.html
Last active April 27, 2017 01:34
HTML Kitchen Sink
<h1>This is the primary heading and there should only be one of these per page</h1>
<p>A small paragraph to <em>emphasis</em> and show <strong>important</strong> bits.</p>
<ul>
<li>This is a list item</li>
<li>So is this - there could be more</li>
<li>Make sure to style list items to:
<ul>
<li>Not forgetting child list items</li>
<li>Not forgetting child list items</li>
<li>Not forgetting child list items</li>
@etoxin
etoxin / grid.scss
Last active May 16, 2017 06:02
Foundation 6 SCSS Cheat Sheet
// Create a row
.class {
@include grid-row;
}
// create a column with options
.class {
@include grid-column(
$columns: 10,
$gutters: 1
@etoxin
etoxin / WebService.js
Last active March 12, 2025 09:45
Sample ES6 Service Class
import forEach from 'lodash/forEach';
/**
* Sample Web Service
* This is a sample service class that uses fetch and promises.
*
* I am using the http://httpbin.org endpoint to ensure this example is working properly.
*
* @class sampleWebService
*/
class sampleWebService {
@etoxin
etoxin / events.js
Created May 30, 2017 04:32
Native JS Stuff
document.body.addEventListener('click', (event) => {
if (event.target.className === 'class-name') {
// do stuff.
}
});
@etoxin
etoxin / javascript.json
Last active June 23, 2017 04:30
VS Code User Snippets
{
"Print to console": {
"prefix": "1",
"body": [
"console.log(${TM_LINE_NUMBER}, '$1');",
"$2"
],
"description": "Log output to console"
},
"Simple function": {
@etoxin
etoxin / export-mongo.md
Last active June 22, 2017 06:00
Export a Mongo DB database

Export a mongo Database

first step is to list all databases. Get into the mongo terminal with mongo and run the follwing command to show all the DBs

show dbs

Show collections