Skip to content

Instantly share code, notes, and snippets.

View jrmarqueshd's full-sized avatar
💭
Desenvolvendo...

Junior Marques jrmarqueshd

💭
Desenvolvendo...
View GitHub Profile
@pjobson
pjobson / setup_cypress_wsl2.md
Last active June 28, 2024 14:19
Setting Up Cypress on Ubuntu WSL2
Connect & Disconnect
---
import json
def lambda_handler(event, context):
print(event)
print("****")
print(context)
@PetrovStark
PetrovStark / get_user_by_meta.sql
Created August 9, 2021 19:46
SQL that filters users by some metadata existance.
SELECT u.ID, u.user_login, u.user_nicename, u.user_email
FROM wp_users u
INNER JOIN wp_usermeta m ON m.user_id = u.ID
WHERE m.meta_key = 'billing_rg'!='';
@mtliendo
mtliendo / fetchFollowerCounts.js
Created October 14, 2020 21:05
retreive a list of followers from twitter
const cheerio = require('cheerio')
const axios = require('axios').default
async function fetchFollowerCounts(usernames) {
const followerData = usernames.map((username) => {
return axios.get(`https://mobile.twitter.com/${username}`).then((res) => {
const $ = cheerio.load(res.data)
const searchContext = `a[href='/${username}/followers']`
const followerCountString = $(searchContext)
.text()
@seeliang
seeliang / lint-only-changed-files.MD
Last active June 10, 2024 05:37
How to lint only changed files?

find out the differences

use git diff to generate file list

git diff --name-only master

limited to certain file types

add ext filter

@spemer
spemer / customize-scrollbar.css
Last active July 18, 2024 13:41
✨ Customize website's scrollbar like Mac OS. Not supports in Firefox and IE.
/* Customize website's scrollbar like Mac OS
Not supports in Firefox and IE */
/* total width */
body::-webkit-scrollbar {
background-color: #fff;
width: 16px;
}
/* background of the scrollbar except button or resizer */
@estrattonbailey
estrattonbailey / react-shortcodes.js
Last active June 5, 2024 15:58
React Shortcodes
import React from 'react'
import { renderToString } from 'react-dom/server'
import parser from './shortcode-parser'
export const add = parser.add
const Aside = ({ children, config }) => {
/**
* config = {
* foo: true,
{
"UF": [
{"nome": "Acre", "sigla": "AC"},
{"nome": "Alagoas", "sigla": "AL"},
{"nome": "Amapá", "sigla": "AP"},
{"nome": "Amazonas", "sigla": "AM"},
{"nome": "Bahia", "sigla": "BA"},
{"nome": "Ceará", "sigla": "CE"},
{"nome": "Distrito Federal", "sigla": "DF"},
{"nome": "Espírito Santo", "sigla": "ES"},
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
SET @oldsite='http://localhost.com';
SET @newsite='http://producao.com.br';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);