Skip to content

Instantly share code, notes, and snippets.

@getaaron
getaaron / irs-get-human.md
Created April 1, 2024 23:01
Get a person at the IRS
  • Call 1-800-829-1040
  • Press 1 for English (or other language as desired)
  • Press 2 for personal tax
  • Press 1 for form / tax history
  • Press 3 for other
  • Press 2 for other
  • Ignore 2 SSN prompts till you get secret other menu
  • Press 2 for personal tax
  • Press 3 for other
  • Wait for agent!
@johanlef
johanlef / README.md
Last active April 27, 2023 18:58
Use CSS custom properties (--var) with bootstrap 4 (SCSS)

The file _functions-override.scss contains the custom functions to handle color conversions within sass and bootstrap.

Bootstrap does not like its sass variables set to css custom properties, e.g. var(--primary). If you use the code snippets below, you can do so, under some conditions.

In the most basic case, you should provide your color variables using the hsl format.

If you insert this using javascript, you can use the script apply-colors.jsx to let js handle the conversion from hex or rgb to hsl.

Reference the main.scss file to import the files in the correct order.

@Martin-Pitt
Martin-Pitt / pan-zoom-touch-and-trackpad.js
Last active December 22, 2023 02:16
Panning and Pinch-Zoom gesture handler for both touchscreens and trackpads; Works really well on a MacBook trackpad
// Target state
var tx = 0;
var ty = 0;
var scale = 1;
function visualiseTargetState() {
box.style.transform = `translate(${tx}px, ${ty}px) scale(${scale})`;
}
@dcleao
dcleao / npm-commands-scripts-life-cycle-phases.md
Last active March 1, 2024 21:27
NPM Commands, Scripts, Life-cycle Phases

NPM Commands, Scripts, Life-cycle Phases

The following describes the behaviour of several npm commands, particularly w.r.t. the scripts that are run in each, for NPM version 6.5.0.

npm build <other-package-folder>

  1. npm run preinstall
  2. link binaries (node-gyp)
  3. for each bin command in other package:
@redthor
redthor / pipelines-status.sh
Last active December 14, 2022 14:59
Bash script for getting bitbucket pipeline status
#!/bin/bash
#
# I made this because bitbucket does not a have a team view on all the
# pipeline builds.
#
# See https://community.atlassian.com/t5/Bitbucket-questions/Where-can-I-get-a-view-of-all-the-pipeline-builds-for-a-team/qaq-p/786264
#
# Requires curl and jq
#
# Use it like this:
@landsman
landsman / draft.js
Last active December 6, 2022 18:06
automatic convert bootstrap v. 3 to bootstrap v. 4 idea ... more on https://github.com/twbs/bootstrap/blob/v4-dev/docs/4.0/migration.md, http://upgrade-bootstrap.bootply.com/
let gulp = require('gulp'),
replace = require('gulp-batch-replace'),
filesExist = require('files-exist');
gulp.task('bt4', () =>
{
let diff = {
'@media (min-width: $screen-xs-min) and (max-width: $screen-sm-max)': '@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, xs))',
'@media (min-width: $screen-xs) and (max-width: ($screen-md-min - 1))': '@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, md)-1)',
@faressoft
faressoft / dom_performance_reflow_repaint.md
Last active March 24, 2024 11:41
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.
@thecodefish
thecodefish / controller.ts
Created September 27, 2017 21:02
AngularJS component example for loading GrapesJS editor
class MyController {
editor: any;
grapesJsConfig: {
//whatever
}
constructor(private readonly $scope: ng.IScope) {}
@anschaef
anschaef / bootstrap-4-sass-mixins-cheat-sheet.scss
Last active April 12, 2024 08:49
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.5.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
/*
// ########################################################################## */
// New cheat sheet for Bootstrap 5:
@zcaceres
zcaceres / Revealing-Module-Pattern.md
Last active April 23, 2024 22:02
Using the Revealing Module Pattern in Javascript

The Revealing Module Pattern in Javascript

Zach Caceres

Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.

The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.

Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.

Using Function Scope to Create Public and Private Methods