Skip to content

Instantly share code, notes, and snippets.

@JBarna
JBarna / dl.js
Created May 17, 2016 05:41
Simple node.js script which downloads mp3 files from https://www.myinstants.com/
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);
@JBarna
JBarna / check_in.txt
Last active November 8, 2020 00:26
The Boss Alexa App
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.
{
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'
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 April 10, 2017 03:30
Example of JavaScript asyncronous nature
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
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.
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 August 29, 2015 14:15
Example of Asynchronous Nature of Node.js JavaScript
/**
* 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