Skip to content

Instantly share code, notes, and snippets.

View js62789's full-sized avatar

Jeffrey Smith js62789

  • GasBuddy LLC
  • Boston, MA
View GitHub Profile
@js62789
js62789 / ExpressTrackingPixel.js
Created March 3, 2023 18:52
This is a simple implementation of a tracking pixel using Express.js
import express from 'express';
const app = express();
const pixel = Buffer.from('R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7', 'base64');
app.get('/pixel.gif', (req, res) => {
res.writeHead(200, {
'Content-Type': 'image/gif',
'Content-Length': pixel.length,

Keybase proof

I hereby claim:

  • I am js62789 on github.
  • I am js62789 (https://keybase.io/js62789) on keybase.
  • I have a public key ASCYsGCF6nojohVXNNN_GemW_Mh4EPPoqnuzzV-bTC5uHQo

To claim this, I am signing this object:

import querystring from 'querystring';
import { RSAA } from 'redux-api-middleware';
function queryKey(obj) {
const ordered = {};
Object.keys(obj).sort().forEach(function(key) {
ordered[key] = obj[key];
});
@js62789
js62789 / launch.json
Last active September 21, 2018 19:26
A set of VSCode configurations that allow for easy client-side debugging of React
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/src",
"preLaunchTask": "start",
@js62789
js62789 / launch.json
Last active July 26, 2018 18:25
A standard set of VSCode configuration files
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Dev Server",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
@js62789
js62789 / CompositeView.js
Created July 31, 2014 21:36
A CompositeView which accepts a loadingView
var CompositeView = Marionette.CompositeView.extend({
_initialEvents: function(){
this._isLoading = true;
if (this.collection){
this.listenTo(this.collection, "add", this.addChildView);
this.listenTo(this.collection, "remove", this.removeItemView);
this.listenTo(this.collection, "reset", this.render);
this.listenTo(this.collection, "sync", function () {
this._isLoading = false;
});
@js62789
js62789 / loadScript.js
Created April 8, 2014 20:01
An asynchronous js loader
function loadScript(url, callback){
var script = document.createElement("script");
script.type = "text/javascript";
if (script.readyState) { // IE
script.onreadystatechange = function () {
if (script.readyState == "loaded" || script.readyState == "complete"){
script.onreadystatechange = null;
callback();
}
<!doctype html>
<html>
<head>
<!-- Run in full-screen mode. -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Make the status bar black with white text. -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
@js62789
js62789 / AppleImages.html
Last active May 8, 2018 20:09
A list of apple touch icons and apple touch startup images
<!-- For iPad with high-resolution Retina display running iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="apple-touch-icon-152x152-precomposed.png">
<!-- For iPad with high-resolution Retina display running iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144x144-precomposed.png">
<!-- For iPhone with high-resolution Retina display running iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="apple-touch-icon-120x120-precomposed.png">
<!-- For iPhone with high-resolution Retina display running iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76-precomposed.png">