Skip to content

Instantly share code, notes, and snippets.

View Tiny-Giant's full-sized avatar

Tiny Giant Tiny-Giant

  • Ladysmith, BC, Canada
View GitHub Profile
@Tiny-Giant
Tiny-Giant / HideJobs.user.js
Last active April 3, 2020 12:32
Hides references to Stack Overflow Jobs
// ==UserScript==
// @name Hide Jobs
// @namespace http://github.com/Tiny-Giant
// @version 1.0.0.1
// @description Hides references to Stack Overflow Jobs
// @author @TinyGiant
// @include /https?:\/\/(meta\.)?stackoverflow\.com/.*/
// @grant none
// ==/UserScript==
/* jshint -W097 */
@Tiny-Giant
Tiny-Giant / jsbin.dunaliv.css
Last active September 24, 2019 21:11
JS BinModal without event-driven paradigm// source https://jsbin.com/dunaliv
html, body {
margin: 0;
height: 100%;
}
modal-wrapper {
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
@Tiny-Giant
Tiny-Giant / jsbin.pahakiq.css
Created September 24, 2019 21:09
JS BinModal with event-driven paradigm// source https://jsbin.com/pahakiq
html, body {
margin: 0;
height: 100%;
}
modal-wrapper {
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
@Tiny-Giant
Tiny-Giant / This answer is a stub. A partial solution for partial answers on Meta.md
Created August 5, 2019 18:24
This answer is a stub. A partial solution for partial answers on Meta

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

#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(/#.+/, ''));

The Close Voter's Guide To Gimme Teh Codez:

How To Moderate How-To Questions

They are not inherently off-topic

It is a common misconception that questions "requesting code" are off-topic. Usually these people express their opinion with the following line:

We are not a code writing service

Yes we are. We write code. We do it all the time. People ask questions, we write code. This is not the only thing we do, but we do write code, and we are a service. So yes, we are a code writing service. Sorry to burst your bubble.

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.

@Tiny-Giant
Tiny-Giant / Tic-Tac-Toe.js
Last active March 12, 2018 00:04
A prompt/confirm tic-tac-toe game using ES6
(() => {
"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 ]
];
<!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;