Skip to content

Instantly share code, notes, and snippets.

View jchadwick's full-sized avatar

Jess Chadwick jchadwick

View GitHub Profile
@jchadwick
jchadwick / PennsburyRotationDays.js
Created September 23, 2024 17:32
Convert Pennsbury School District rotation day HTML table to Google Calendar CSV import
const fs = require('fs');
const cheerio = require('cheerio');
const path = require('path');
const inputFilePath = path.join(__dirname, 'table.html');
const outputFilePath = path.join(__dirname, 'output.csv');
const DateHeader = 'Date';
const RotationDayHeader = 'Rotation Day';
@jchadwick
jchadwick / test.js
Created December 10, 2020 17:14
Tedious encrypted MSSQL connection
var Connection = require("tedious").Connection;
var Request = require("tedious").Request;
const server = "sqlproxy";
const port = 10009;
const database = "database";
const user = "user";
const password = "ffffffff";
const query = `select app_name()`;
@jchadwick
jchadwick / executeHttp.js
Last active October 9, 2019 14:42
String template -> KY request
const parser = require("http-message-parser");
const ky = require("ky-universal");
const targetUrl = "https://postman-echo.com";
function executeHttp(strings) {
const rawRequest = parser(strings.join("\n"));
const {
url,
@jchadwick
jchadwick / conemu.xml
Created April 19, 2018 03:47
cmder\vendor\conemu-maximus5\ConEmu.xml
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2018-04-18 23:21:27" build="161206">
<value name="ColorTable00" type="dword" data="00222827"/>
<value name="ColorTable01" type="dword" data="009e5401"/>
<value name="ColorTable02" type="dword" data="0004aa74"/>
<value name="ColorTable03" type="dword" data="00a6831a"/>
<value name="ColorTable04" type="dword" data="003403a7"/>
<value name="ColorTable05" type="dword" data="009c5689"/>
@jchadwick
jchadwick / syncGit.sh
Last active December 2, 2016 05:24
Lynda.com courseware helpers
#!/bin/bash
gitRepo=$1
repoName=$(echo $1 | sed '$s/.*\/\([^/]*$\)/\1/')
dest="$(dirname $(pwd))/$repoName-sync"
branch="ExerciseFiles"
if [ -d "$dest" ]; then
rm -rf $dest
fi
@jchadwick
jchadwick / Player.js
Created July 2, 2016 06:30
Warrior.js - beginner
const MaxHealth = 20,
DangerousHealth = 7,
Forward = 'forward',
Backward = 'backward',
Left = 'left',
Right = 'right',
Directions = [Backward, Forward, Left, Right];
class Player {
@jchadwick
jchadwick / LoggingDecorators.ts
Created February 25, 2016 07:28
TypeScript Decorators
function createSignature(instance, property, args) {
var className = instance.constructor.name,
argsString = args.map(JSON.stringify).join(', ');
return `${className}.${property}(${argsString})`;
}
export function LogMethodDecorator(): MethodDecorator {
return function(target, property: string, descriptor: TypedPropertyDescriptor<Function>) {
@jchadwick
jchadwick / NuGetPackager.targets
Last active February 7, 2016 05:49
NuGetPackager
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Get Package Version from TFS BuildNumber if available, otherwise default to today's date -->
<BuildVersion Condition=" '$(BuildVersion)' == '' And '$(TF_BUILD_BUILDNUMBER)' != ''">$(TF_BUILD_BUILDNUMBER.Substring($([MSBuild]::Add($(TF_BUILD_BUILDDEFINITIONNAME.Length), 1))))</BuildVersion>
<BuildVersion Condition=" '$(BuildVersion)' == ''">$([System.DateTime]::Now.ToString(`yyMM.ddHH`))</BuildVersion>
<MajorVersion Condition=" '$(MajorVersion)' == ''">1</MajorVersion>
<PreReleaseVersion Condition=" '$(PreReleaseVersion)' == ''"></PreReleaseVersion>
<PackageVersion Condition=" '$(PackageVersion)' == ''">$(MajorVersion).$(BuildVersion)</PackageVersion>
@jchadwick
jchadwick / Routing.js
Last active October 9, 2015 05:36
Angular Bootcamp snippets
.config(function ($routeProvider) {
$routeProvider
.when('/view', {
templateUrl: 'pages/view.html',
})
.when('/edit', {
templateUrl: 'pages/edit.html',
})
.when('/details/:todoId', {
templateUrl: 'pages/details.html',
@jchadwick
jchadwick / ngLazyLoad
Last active October 2, 2015 01:21
Angular Lazy-Loading
(function (angular) {
angular._module = angular.module;
angular.module = function () {
var module = angular._module.apply(angular, arguments);
enableLazyLoading.$inject = ['$controllerProvider', '$provide', '$compileProvider'];
function enableLazyLoading($controllerProvider, $provide, $compileProvider) {