Skip to content

Instantly share code, notes, and snippets.

View filoscoder's full-sized avatar
🇪🇸
WFH

Daniel Son filoscoder

🇪🇸
WFH
  • Spain
  • 22:38 (UTC +02:00)
View GitHub Profile
@creativecreatorormaybenot
creativecreatorormaybenot / OpacityHex.markdown
Last active July 10, 2024 11:05 — forked from passiondroid/OpacityHex.markdown
Opacity Percentage to Flutter Opacity Hex Color code

Flutter uses hexadecimal ARGB values for colors, which are formatted as const Color(0xAARRGGBB). That first pair of letters, the AA, represent the alpha channel. You must convert your decimal opacity values to a hexadecimal value. Here are the steps:

Alpha Hex Value Process

  • Take your opacity as a decimal value and multiply it by 255. So, if you have a block that is 50% opaque the decimal value would be .5. For example: .5 x 255 = 127.5

  • The fraction won't convert to hexadecimal, so you must round your number up or down to the nearest whole number. For example: 127.5 rounds up to 128; 55.25 rounds down to 55.

  • Enter your decimal value in a decimal-to-hexadecimal converter, like http://www.binaryhexconverter.com/decimal-to-hex-converter, and convert your values.

@mortezashojaei
mortezashojaei / mediaQuery.ts
Last active June 19, 2023 07:45
use media query in styled components ( DRY )
const mediaQuery = (key: keyof typeof screens) => {
return (style: TemplateStringsArray | String) => `@media (max-width: ${screens[key]}px) { ${style} }`;
};
@brunolemos
brunolemos / linkedin-unfollow-everyone.js
Last active February 3, 2024 05:47
Unfollow everyone on Linkedin
(() => {
let count = 0;
function getAllButtons() {
return document.querySelectorAll('button.is-following') || [];
}
async function unfollowAll() {
const buttons = getAllButtons();
@madhums
madhums / graphql-go-mongodb-example.go
Created May 6, 2019 20:47 — forked from trunet/graphql-go-mongodb-example.go
Minimal example of GraphQL Golang and MongoDB playing nicely together. Edit
// Embedded in this article https://medium.com/p/c98e491015b6
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
@bmaupin
bmaupin / free-database-hosting.md
Last active July 16, 2024 16:41
Free database hosting
@bmaupin
bmaupin / free-backend-hosting.md
Last active July 17, 2024 11:56
Free backend hosting
@felipeochoa
felipeochoa / DOCX spec.md
Created March 8, 2017 19:37
Quick overview of how the DOCX format works

How the DOCX spec works

The standard can be downloaded from the ISO website at [this direct link][iso direct link]

DOCX documents are a zipped folder containing several interacting components in a word doc. The main ones are:

  • word/document.xml: The main document content
  • word/styles.xml: Name style information (e.g. "Header 1"), similar to CSS
@trey
trey / git-commit-author-rewrite.md
Last active July 3, 2024 15:56
Change the email address for a git commit.

Change the email address for a git commit.

$ git commit --amend --author="Author Name <email@address.com>"

or

$ git commit --amend --reset-author