Skip to content

Instantly share code, notes, and snippets.

@codejockie
codejockie / user.xml
Created October 17, 2018 04:12
Custom config for Logitech SetPoint app
<Source>
<UserOptions>
<UserOption Name="ShowTrayIcon">1</UserOption>
<UserOption Name="ShowVolumeSettings">1</UserOption>
<UserOption Name="BeepKeyboardSettings">0</UserOption>
<UserOption Name="ShowKeyboardPopupSettings">1</UserOption>
<UserOption Name="ShowKeyboardTraySettings">1</UserOption>
<UserOption Name="ShowKeyboardSettings">1</UserOption>
<UserOption Name="ShowBatteryStatusSettings">1</UserOption>
<UserOption Name="ShowKeySettings">1</UserOption>
@codejockie
codejockie / nodejs_aws_s3_file_upload.js
Created July 18, 2018 17:37 — forked from sarfarazansari/nodejs_aws_s3_file_upload.js
How to upload files to AWS S3 with NodeJS - AWS-SDK? With the help of this library you can upload any kind of file to s3. (NODEJS, AWS-SDK, S3)
/**
* we are going to upload file to s3 via node js by using
* aws-sdk - required
* busboy - required
* uuid - optional - for image renaming purpose
* with this library you can upload any kind of file to s3 via node js.
*/
const AWS = require('aws-sdk');
const UUID = require('uuid/v4');
@codejockie
codejockie / ie-shims.js
Created April 11, 2018 22:33 — forked from djKianoosh/ie-shims.js
IE shims for array indexOf, string startsWith and string trim
// Some common IE shims... indexOf, startsWith, trim
/*
Really? IE8 Doesn't have .indexOf
*/
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
"use strict";
if (this === null) {
throw new TypeError();
@codejockie
codejockie / flatMap.js
Created April 8, 2018 19:09 — forked from samgiles/flatMap.js
Javascript flatMap implementation
// [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (:
Array.prototype.flatMap = function(lambda) {
return Array.prototype.concat.apply([], this.map(lambda));
};
@codejockie
codejockie / launch.json
Last active December 26, 2018 00:18
VS Code Debugger Launch Configuration
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
@codejockie
codejockie / authentication.js
Created March 6, 2018 18:38 — forked from marshallswain/authentication.js
Example tools for using querystring redirects with Feathers OAuth login.
'use strict';
const authentication = require('feathers-authentication');
const jwt = require('feathers-authentication-jwt');
const local = require('feathers-authentication-local');
const oauth2 = require('feathers-authentication-oauth2');
const GithubStrategy = require('passport-github');
// Bring in the oauth-handler
const makeHandler = require('./oauth-handler');

Skills Expected of a JS Developer Based on Level

Beginner JS Developer:

As a beginner you should be proficient in the following:

  • Grammar and Types
    • Basic syntax & comments
    • Declarations
    • Variable scope
  • Variable hoisting
@codejockie
codejockie / Coin.swift
Last active January 24, 2018 09:31
Just a reusable code
//
// Coin.swift
// Crypto Price Tracker
//
// Created by Kennedy on 22/01/2018.
// Copyright © 2018 Kennedy. All rights reserved.
//
import Foundation
@codejockie
codejockie / array_iteration_thoughts.md
Created December 10, 2017 16:05 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

@codejockie
codejockie / script.sh
Created November 29, 2017 08:20
A basic shell script to that create directories, copy files, pipe input, execute commands etc
#! /bin/bash
cd ~ # moves to the home directory
mkdir "dev" # creates a new directory
cd "dev" # navigates to the newly created directory
mkdir "learning-bash"
cd "learning-bash"