Skip to content

Instantly share code, notes, and snippets.

@JBarna
JBarna / check_in.txt
Last active Nov 8, 2020
The Boss Alexa App
View check_in.txt
Wait, how did you get in the building. I thought we had you fired? Tracy - call security, we have an intruder.
Honestly, you look like you woke up in a garbage can.
If you have time to talk to Alexa, then you should probably get the hell back to work.
You didn't get enough done today, I'm ordering a purple mattress so you can sleep here tonight and think about what you've done.
View slack api response
{
type: 'message_action',
token: 'RNppZR7dUZW0qGyZ6haVJ9V8',
action_ts: '1593826376.176709',
team: { id: 'T016JFQ2MNV', domain: 'jb-co-company' },
user: {
id: 'U016C2N10JY',
name: 'joel_test',
username: 'joel_test',
team_id: 'T016JFQ2MNV'
View hill.js
const hill = [4, 2, 4, 1, 5, 3, 16, 6, 17, 19, 4, 13, 5, 3, 10, 10, 13, 6, 2, 1, 5, 15,
13, 19, 16, 9, 13, 1, 7, 18, 20, 13, 9, 7, 2, 10, 8, 18, 4, 7, 5, 8, 10, 13,
7, 18, 19, 2, 19, 8, 10, 10, 17, 6, 6, 20, 20, 11, 10, 11, 13, 9, 7, 1, 10,
5, 12, 16, 10, 7, 15, 13, 12, 10, 1, 1, 4, 2, 16, 10, 20, 17, 11, 19, 19, 20,
9, 10, 17, 9, 18, 8, 10, 18, 8, 19, 16, 17, 3, 1]
// now traverse
const previousPoints = []
var waterUnits = 0
@JBarna
JBarna / async.js
Created Apr 10, 2017
Example of JavaScript asyncronous nature
View async.js
for (var i = 0; i < 10; i++ ){
setTimeout( function() {
console.log( "value is " + i);
}, 1000);
}
// what will the output be?
// go to https://goo.gl/lFkgcr to run the code
View gist:1be1108a1eb1581e90d81e7e91030cf3
PART 4
APFT Pass
c. Met standard
SGT Chase embodies the roll of the Army Values. SGT Chase is always available to help other soldiers and is disciplined in and outside of duty.
d. Presence
* Soldier's physical appearance is always groomed and professional.
* Able to build self after receiving constructive criticism.
@JBarna
JBarna / dl.js
Created May 17, 2016
Simple node.js script which downloads mp3 files from https://www.myinstants.com/
View dl.js
var https = require('https'),
URL = require('url'),
fs = require('fs'),
path = require('path');
// usage
if (process.argv[2] == null){
console.log("Usage: node dl <downloadurl 1> <downloadurl 2> ... <downloadurl n> ");
console.log("Where the download url is from https://www.myinstants.com/");
process.exit(1);
View drag.js
window.ondragover = function(e) { e.preventDefault(); return false; };
window.ondrop = function(e) { e.preventDefault(); return false; };
var holder = window.document.getElementById('currentDirectory');
holder.ondragover = function () { return false; };
holder.ondragleave = function () { return false; };
holder.ondrop = function(e){
e.preventDefault();
e.stopPropagation();
@JBarna
JBarna / asyncExample.js
Last active Aug 29, 2015
Example of Asynchronous Nature of Node.js JavaScript
View asyncExample.js
/**
* Even though javascript doesn't have types, there are many
* languages that people have built which complie to legitemate JS.
* Check out TypeScript at http://www.typescriptlang.org/
* For more information*/
/**
* The output of this file is as follows:
- Before myFun
- Value is : 6