Skip to content

Instantly share code, notes, and snippets.

View shawnmclean's full-sized avatar
🐭
:)

Shawn Mclean shawnmclean

🐭
:)
View GitHub Profile
@danieldietrich
danieldietrich / README.md
Last active February 14, 2024 13:15
The easiest way to bundle a simple TypeScript web application

THIS README IS OUTDATED AND UNMAINTAINED - PLEASE DON'T RELY ON THIS

The easiest way to bundle a simple TypeScript web application

Packaging JavaScript applications can be a bit overwhelming. The popular project uglifyjs does not support ES6, it is cumbersome to configure the allmighty Webpack, bundlers like Parcel and Microbundle still have bugs or do not compile to ESM bundles that work in a browser. It is hard to figure out the best way to bundle an application.

Here I give a small example, how we achieve the goal using the

@JamesMenetrey
JamesMenetrey / README.md
Last active September 29, 2022 08:27
Install Oh-My-Zsh + iTerm2 with Solarized + System-wide console in 2017 (macOS)

Install iTerm2 with Solarized in 2017

Here is the looks and feel of your terminal once the tutorial has been applied on your system:

Install iTerm2

Using Homebrew:

@cdroulers
cdroulers / trx-to-junit.xslt
Last active February 28, 2020 14:52
Transform dotnet test output (TRX) to jUnit format for CI purposes.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a ="http://microsoft.com/schemas/VisualStudio/TeamTest/2006" xmlns:b ="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" >
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<testsuites>
<xsl:variable name="buildName" select="//a:TestRun/@name"/>
<xsl:variable name="numberOfTests" select="count(//a:UnitTestResult/@testId) + count(//b:UnitTestResult/@testId)"/>
<xsl:variable name="numberOfFailures" select="count(//a:UnitTestResult/@outcome[.='Failed']) + count(//b:UnitTestResult/@outcome[.='Failed'])" />
<xsl:variable name="numberOfErrors" select="count(//a:UnitTestResult[not(@outcome)]) + count(//b:UnitTestResult[not(@outcome)])" />
<xsl:variable name="numberSkipped" select="count(//a:UnitTestResult/@outcome[.!='Passed' and .!='Failed']) + count(//b:UnitTestResult/@outcome[.!='Passed' and .!='Failed'])" />
// @flow
/* eslint-disable */
declare module 'redux-form' {
declare export type InputProps = {
checked?: boolean,
name: string,
value: any,
onBlur: Function,
onChange: Function,
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@TurplePurtle
TurplePurtle / sourceFromFile.js
Created October 27, 2012 21:36
Load sound from local file for Web Audio API
// Audio Buffer Source
var fileInput = $("#audio-file");
bufferSource.gain.value = 1;
bufferSource.loop = true;
bufferSource.connect(oscillatorGain);
fileInput.addEventListener("change", function() {
var reader = new FileReader();
reader.onload = function(ev) {
context.decodeAudioData(ev.target.result, function(buffer) {