Skip to content

Instantly share code, notes, and snippets.

View raulingg's full-sized avatar
🛠️
Fixing bugs

Raul Quispe raulingg

🛠️
Fixing bugs
View GitHub Profile
@raulingg
raulingg / advanced-sidebar-menu-multi-level-unlimited-navigation.markdown
Created October 20, 2023 23:28
advanced sidebar menu (multi level - unlimited navigation)

advanced sidebar menu (multi level - unlimited navigation)

multi level and unlimited advanced sidebar navigation

A Pen by Raul Quispe on CodePen.

License.

@raulingg
raulingg / hacker-news-job-board-challenge.md
Last active May 24, 2023 16:21
React code challenge for tech interviews

Hacker News Job Board

Build a job board that displays the latest job postings fetched from the Hacker News API, with each posting displaying the job title, poster, and date posted.

example

Requirements

  • The page should show 6 jobs on initial load with a button to load more postings.
@raulingg
raulingg / javascript-remove-accents.js
Created September 16, 2022 16:42 — forked from marcelo-ribeiro/javascript-remove-accents.js
An Javascript function to remove accents and others characters from an input string.
// Example: https://codepen.io/marcelo-ribeiro/pen/OJmVOyW
const accentsMap = new Map([
["A", "Á|À|Ã|Â|Ä"],
["a", "á|à|ã|â|ä"],
["E", "É|È|Ê|Ë"],
["e", "é|è|ê|ë"],
["I", "Í|Ì|Î|Ï"],
["i", "í|ì|î|ï"],
["O", "Ó|Ò|Ô|Õ|Ö"],
@raulingg
raulingg / media.json
Created September 8, 2022 22:12 — forked from deepakpk009/media.json
sample free video urls
{
"categories": [
{
"name": "Movies",
"videos": [
{
"description": "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources": [
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
],
@raulingg
raulingg / streamFileUpload.js
Created September 8, 2022 02:58
Streams a file upload with Express and Stream Node API
// Load the necessary modules and define a port
const app = require('express')();
const fs = require('fs');
const path = require('path');
const port = process.env.PORT || 3000;
// Take in the request & filepath, stream the file to the filePath
const uploadFile = (req, filePath) => {
return new Promise((resolve, reject) => {
const stream = fs.createWriteStream(filePath);
@raulingg
raulingg / iterm2.md
Created March 15, 2022 20:22 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@raulingg
raulingg / gitstats.sh
Created December 12, 2020 17:12 — forked from xeoncross/gitstats.sh
Git - calculate how many lines of code were added/changed by someone
# Run this in the project repo from the command-line
# http://stackoverflow.com/a/4593065/99923
git log --shortstat --author "Xeoncross" --since "2 weeks ago" --until "1 week ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'
@raulingg
raulingg / .eslintrc
Created November 7, 2020 17:10
My ESLint config for Next.js
{
"root": true, // Make sure eslint picks up the config at the root of the directory
"parserOptions": {
"ecmaVersion": 2020, // Use the latest ecmascript standard
"sourceType": "module", // Allows using import/export statements
"ecmaFeatures": {
"jsx": true // Enable JSX since we're using React
}
},
"settings": {
@raulingg
raulingg / feature-flags.md
Created August 8, 2020 23:58 — forked from threepointone/feature-flags.md
Feature flags: why, how, all that

(I'm enjoying doing these raw, barely edited writeups; I hope they're useful to you too)

Feature flags

This is my own writeup on feature flags; for a deep dive I'd recommend something like Martin Fowler's article (https://martinfowler.com/articles/feature-toggles.html).

So. Feature flags. The basic idea that you'll store configuration/values on a database/service somewhere, and by changing those values, you can change the user experience/features for a user on the fly.

Let's say that you're building a new feature, called 'new-button' which changes the color of buttons, which is currently red, to blue. Then you'd change code that looks like this -

@raulingg
raulingg / validation-for-instapage-form.html
Last active April 2, 2020 20:03
Script to validate the application form of the Laboratoria's admission process in Instapage
<script>
ijQuery(document).ready(function() {
$('.page-block')
.first()
.addClass('stickyheader')
var firstSection = $('.stickyheader').height()
$('body').css('margin-top', firstSection)
})
</script>