Skip to content

Instantly share code, notes, and snippets.

View HugoLiconV's full-sized avatar
🐛
Creating bugs

Hugo HugoLiconV

🐛
Creating bugs
View GitHub Profile
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@siakaramalegos
siakaramalegos / resources.md
Last active June 15, 2020 21:19
Modern JavaScript for Modern Browsers resource list

Vintage Bundles, aka Modern JavaScript for Modern Browsers

Web performance matters. From SEO to bottom-line revenue impacts, performance can make or break your app. However, fixing performance feels like a quagmire of expert-level topics. What if I told you JavaScript bundle sizes could be cut up to 50% by doing one thing only? Nearly 90% of web traffic runs on modern browsers, but we're transpiling all of our JavaScript to ES5. That’s expensive. In this talk, we'll learn about differential serving, or serving both modern bundles and legacy bundles using webpack. This talk is framework agnostic, and best if you have at least a basic understanding of JavaScript.

Slides and Controls

The slides are deployed here. To advance the slides, use n for next and p for previous. The right arrow jumps to the next section (and left for previous section). Up and down to advance through slides within a section.

Articles and research/tests

  • [Deploying ES2015+ Co
@thomashagstrom
thomashagstrom / GetJwtToken.test.ts
Last active October 23, 2023 14:52
Mock for single test
import { Auth } from 'aws-amplify';
import GetJwtToken from './GetJwtToken';
describe('jwt', () => {
describe('GetJwtToken', () => {
it('Original mock for Auth class', async () => {
const result: Error = (await GetJwtToken()) as Error;
expect(result.message).toBe('Could not get session');
});
@mswell
mswell / config
Last active May 27, 2023 21:20
Terminator Dracula theme
[global_config]
window_state = maximise
handle_size = 0
title_hide_sizetext = True
title_transmit_fg_color = "#bd93f9"
title_inactive_fg_color = "#f8f8f2"
title_receive_bg_color = "#282a36"
title_transmit_bg_color = "#282a36"
title_receive_fg_color = "#8be9fd"
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active June 18, 2024 11:27
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@NickNaso
NickNaso / proxy.js
Last active January 25, 2023 18:40
Log or modify the request body in the node-http-proxy before to pass it to the express.js application
/*******************************************************************************
* Copyright (c) 2017 Nicola Del Gobbo
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the license at http://www.apache.org/licenses/LICENSE-2.0
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
* OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
* IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
* MERCHANTABLITY OR NON-INFRINGEMENT.
@clarkbw
clarkbw / users.yml
Created January 14, 2014 14:06
Devise user fixture for testing rails with users. confirm* items are only required if you've set :confirmable in your model.
bryan:
email: clarkbw@example.com
encrypted_password: <%= User.new.send(:password_digest, '1234567890') %>
confirmed_at: <%= Time.zone.now - 1.hour %>
confirmation_sent_at: <%= Time.zone.now - 2.hours %>
@briancavalier
briancavalier / simple-promise-retry.js
Created February 24, 2011 18:35
A few general patterns for retries using promises
function keepTrying(otherArgs, promise) {
promise = promise||new Promise();
// try doing the important thing
if(success) {
promise.resolve(result);
} else {
setTimeout(function() {
keepTrying(otherArgs, promise);