Skip to content

Instantly share code, notes, and snippets.

View medeirosjoaquim's full-sized avatar
🎯
Focusing

Joaquim medeirosjoaquim

🎯
Focusing
View GitHub Profile
@medeirosjoaquim
medeirosjoaquim / 00-README-NEXT-SPA.md
Created April 7, 2023 12:43 — forked from gaearon/00-README-NEXT-SPA.md
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@medeirosjoaquim
medeirosjoaquim / cli.js
Created September 13, 2022 22:24 — forked from mattdesl/cli.js
colour palette from text prompt using Stable Diffusion https://twitter.com/mattdesl/status/1569457645182152705
/**
* General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts.
*
* Note that this uses an older fork of stable-diffusion
* with the 'txt2img.py' script, and that script was modified to
* support the --outfile command.
*/
var { spawn, exec } = require("child_process");
var path = require("path");
@medeirosjoaquim
medeirosjoaquim / google-dorks
Created July 17, 2022 20:39 — forked from stevenswafford/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@medeirosjoaquim
medeirosjoaquim / export-svg-inkscape.md
Created March 27, 2020 03:19 — forked from brenopolanski/export-svg-inkscape.md
Exporting an object as svg from inkscape
  1. Select the object(s) to export
  2. Open the document properties window (Ctrl+Shift+D)
  3. Select "Resize page to drawing or selection"
  4. File > Save As Copy...
  5. Select Optimized SVG as the format if you want to use it on the web
@medeirosjoaquim
medeirosjoaquim / weechat_theme.txt
Created March 8, 2020 22:54 — forked from fats/weechat_theme.txt
[weechat] The Theme™
# requires: 256 color terminal
/script install iset.pl
/script install buffers.pl
/script install colorize_nicks.py
/set weechat.look.buffer_notify_default message
/set weechat.look.color_nick_offline on
/set weechat.look.prefix_action " •"
/set weechat.look.prefix_join "▬▶"
@medeirosjoaquim
medeirosjoaquim / twittermute.txt
Created March 8, 2020 22:49 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@medeirosjoaquim
medeirosjoaquim / install-fonts.txt
Created March 8, 2020 22:49 — forked from matthewhartman/install-fonts.txt
Install TTF Fonts in Debian
cd fonts
mv *.ttf /usr/share/fonts/truetype
cd /usr/share/fonts/truetype
mkfontscale
mkfontdir
fc-cache
xset fp rehash
@medeirosjoaquim
medeirosjoaquim / reduceExamples.js
Created February 24, 2020 01:18 — forked from quangnd/reduceExamples.js
Some examples about reduce() in Javascript
//Example 1 - Calculate average value of an array (transform array into a single number)
var scores = [89, 76, 47, 95]
var initialValue = 0
var reducer = function (accumulator, item) {
return accumulator + item
}
var total = scores.reduce(reducer, initialValue)
var average = total / scores.length
/*Explain about function
@medeirosjoaquim
medeirosjoaquim / ngrxintro.md
Created February 12, 2020 00:03 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@medeirosjoaquim
medeirosjoaquim / Request.ts
Created March 27, 2019 12:35 — forked from azarus/Request.ts
SIMPLE AND EASY HTTP REQUESTS IN ANGULAR2! GET A PROMISE AND USE IT EASILY!
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Config } from '../Config';
import { Observable } from 'rxjs/Observable';
import 'rxjs/Rx';
@Injectable()
export class Request {
constructor(public http: Http)