Skip to content

Instantly share code, notes, and snippets.

View corydorning's full-sized avatar

Cory Dorning corydorning

View GitHub Profile
@maatthc
maatthc / aws-websockets-api-gw-mock.yaml
Last active April 30, 2024 18:13
Basic WebSocket mock in AWS ApiGateway using CloudFormation in AWS
AWSTemplateFormatVersion: '2010-09-09'
Description: |
AWS CloudFormation template for Mock WebSocket API Gateway. When deploying this stack please remember to check the option:
- I acknowledge that AWS CloudFormation might create IAM resources.
This template can help you to solve issues like:
- CloudWatch Logs role ARN must be set in account settings to enable logging
- Execution failed due to configuration error: statusCode should be an integer which defined in request template
- This custom domain name cannot map to WEBSOCKET protocol APIs
- Error during WebSocket handshake: Unexpected response code: 500
@bettysteger
bettysteger / es6-classes-inheritance.js
Last active October 11, 2020 00:05
ES6 Classes and Inheritance example (www.es6fiddle.net)
/**
* Classes and Inheritance
* Code Example from http://www.es6fiddle.net/
*/
class Polygon {
constructor(height, width) { //class constructor
this.name = 'Polygon';
this.height = height;
this.width = width;
}
@dashed
dashed / gulpfile-env.js
Created January 7, 2014 12:38
Interesting and useful gulp snippets.
/*
From https://github.com/gulpjs/gulp/issues/101. Organize gulpfile.js using concept of environment variables.
1. Set up sub-tasks to behave in a certain according to env var; may be env agnostic.
2. Set up high-level tasks to run a group of sub-tasks to orchestrate a behaviour (testing, staging, prod, etc)
*/
var R = 0;
var ENV_SWITCH = void 0;
@justinbmeyer
justinbmeyer / jsmem.md
Last active June 29, 2024 16:00
JS Memory

JavaScript Code

var str = "hi";

Memory allocation:

Address Value Description
...... ...
@kizu
kizu / dabblet.css
Created November 28, 2012 13:04
CSS Dot Leaders With Textured Background
/**
* CSS Dot Leaders With Textured Background
*/
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
font: 20px/1.4 Helvetica, Arial sans-serif
}
@Potherca
Potherca / README.md
Last active November 27, 2023 17:44
Create a branch on Github without access to a local git repo using http://hurl.eu/

Ever had the need to create a branch in a repo on Github without wanting (or being able) to access a local repo?

With the aid of [the Github API][1] and any online request app this is a piece of cake!

Just follow these steps:

  1. Open an online request app (like apirequest.io, hurl.it pipedream.com, reqbin.com, or webhook.site)
  2. Find the revision you want to branch from. Either on Github itself or by doing a GET request from Hurl: https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs/heads
  3. Copy the revision hash
  4. Do a POST request from Hurl to https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs with the following as the POST body :
@corydorning
corydorning / Cross-Browser ::before and ::after pseudo-class polyfill
Last active February 18, 2022 00:24
Cross-Browser ::before and ::after pseudo-class polyfill
/* =============================================================================
CSS Declarations
========================================================================== */
/* ==|== The Standard Way =================================================== */
.foo::before {
/* ...css rules... */
}
@corydorning
corydorning / dialog._makedraggable
Created September 22, 2011 19:22
jQuery UI Dialog - Remove Containment
$.ui.dialog.prototype._makeDraggable = function() {
this.uiDialog.draggable({
containment: false,
handle: '.ui-dialog-titlebar'
});
};
@corydorning
corydorning / jquery-stripeRows.js
Created May 12, 2011 15:53
Simple jQuery table striping
/*
* jQuery Table Striping - v0.1 - 05/12/2011
* http://corydorning.com, http://justinrains.com
*
* Dual licensed under 'Use it like you stole it'
* and 'We Don't Care'.
*
* Description: Stripe table rows easily by calling 'stripeRows'
* on any collection of <tr> elements and passing in the desired
* colors.
@boazsender
boazsender / jquery.pubsub.js
Created May 8, 2011 02:55
Implementing what a static jQuery pubsub might look like even though everyone hates the idea.
/*
usage:
$.bind('customEvt', function( event ){
console.log( event );
});
$.trigger('customEvt');
*/