Skip to content

Instantly share code, notes, and snippets.

View seantunwin's full-sized avatar

Sean T. Unwin seantunwin

View GitHub Profile

Cheat sheet: classes in JavaScript

Basic members of classes

class OtherClass {}

class MyClass1 extends OtherClass {

  publicInstanceField = 1;

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@Geoff-Ford
Geoff-Ford / composing-software.md
Last active May 31, 2024 22:32
Eric Elliott's Composing Software Series

Eric Elliott's "Composing Software" Series

A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.

Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.

@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@adamjmcintyre
adamjmcintyre / gist:3098766
Created July 12, 2012 15:15
Using CSS keyframe animationend event cross-browser with jQuery
$('.some-els').bind('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function(){
// Do something!
$(this).removeClass('animation-class');
})
.addClass('animation-class');
// One works, too
$('.some-els').one('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function(){
// Do something once!
console.log('this would show once');
@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/