Skip to content

Instantly share code, notes, and snippets.

Tiny Giant Tiny-Giant

  • Ladysmith, BC, Canada
Block or report user

Report or block Tiny-Giant

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Tiny-Giant
Tiny-Giant / This answer is a stub. A partial solution for partial answers on Meta.md
Created Aug 5, 2019
This answer is a stub. A partial solution for partial answers on Meta
View This answer is a stub. A partial solution for partial answers on Meta.md

I'm fairly certain most of us have seen this text at some point on Wikipedia:

This article is a stub. You can help Wikipedia by expanding it.

- https://en.wikipedia.org/wiki/Template:Stub

With the primary goal of a frictionless option for partial answers to encourage:

  • those with partial answers to post their partial answers using the answer form instead of the comment form, and
  • the community to jump in and help flesh out such partial answers instead of downvoting them because they aren't fleshed out
View Programming Problems.md

How to create a programming problem

Programming problems must be both well defined and reasonably scoped.

  • Well defined programming problems are clear and unambiguous. They must not be open to interpretation and all important variables(?) must be defined and accounted for.

    // Examples of poorly defined and well defined programming problems

  • Reasonably scoped programming problems are distilled to a specific problem, without being overly specific. Trying to cover too much ground and including too many details both reduce the usefulness of the question and the likeliness of receiving an answer, and can lead to question closure.

View Closure related events for How to make a great R reproducible example.md
View gist:085436cedae02b0b9c2ee80b59ca28ad
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
View lazy_mandelbrot.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
View intercept and manipulate ajax.js
const XHR = XMLHttpRequest;
unsafeWindow.XMLHttpRequest = new Proxy(XHR, {
construct: (target, args) => {
const listeners = [{
regex: /close\/add/,
get: data => {
if(data.property === 'responseText') {
console.log(xhr.responseText);
const obj = JSON.parse(xhr.responseText);
View jQuery is bad mmkay.md

#BAD!

$('.link').on('click', _ => $('.link').attr('href', $('.link').attr('href').replace(/#.+/,'')));

#GOOD!

const link = $('.link');
link.on('click', _ => link.attr('href', link.attr('href').replace(/#.+/, ''));
@Tiny-Giant
Tiny-Giant / Tic-Tac-Toe.js
Last active Mar 12, 2018
A prompt/confirm tic-tac-toe game using ES6
View Tic-Tac-Toe.js
(() => {
"use strict";
const game = () => {
let done;
const solutions = [
[ 0, 1, 2 ], [ 0, 3, 6 ], [ 0, 4, 8 ],
[ 1, 4, 7 ], [ 2, 4, 6 ], [ 2, 5, 8 ],
[ 3, 4, 5 ], [ 6, 7, 8 ]
];
View deepmerge.js
const deepmerge = (h, ...args) => {
const gettype = e => Object.prototype.toString.call(e).replace(/.*\b(\w+)./, '$1');
const o = {};
Object.assign(h, {
"Array": (a, b) => [...a, ...b],
"Object": (a, b) => deepmerge(h, a, b),
"Set": (a, b) => new Set([...a, ...b]),
"Map": (a, b) => {
View RequestGenerator.user.js
// ==UserScript==
// @name CV Request Generator
// @namespace https://github.com/SO-Close-Vote-Reviewers/
// @version 2.0.0.2
// @description This script generates formatted close vote requests and sends them to a specified chat room
// @author @TinyGiant
// @include /^https?:\/\/(?!chat)\w*.?(stackexchange.com|stackoverflow.com|serverfault.com|superuser.com|askubuntu.com|stackapps.com|mathoverflow.net)\/.*/
// @updateURL https://github.com/Tiny-Giant/myuserscripts/raw/master/CVRequestGenerator.user.js
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
You can’t perform that action at this time.