Skip to content

Instantly share code, notes, and snippets.

View diogenesc's full-sized avatar
🏠
Working from home

Diógenes Castro diogenesc

🏠
Working from home
View GitHub Profile
@leandronsp
leandronsp / 001-server.bash
Last active July 18, 2024 08:54
A complete yet simple Web server (with login & logout system) written in Shell Script
#!/bin/bash
## Create the response FIFO
rm -f response
mkfifo response
function handle_GET_home() {
RESPONSE=$(cat home.html | \
sed "s/{{$COOKIE_NAME}}/$COOKIE_VALUE/")
}
@gui25
gui25 / unfollow-non-followers-twitter.js
Last active April 18, 2023 01:32 — forked from jalbam/unfollow-non-followers-twitter.js
Code to stop following those ones who are not following you back on Twitter and keeping those you want or follow anyone you want, with certain filters (working in July 2019)
/*
Unfollow (stop following) those people who are not following you back on Twitter (or unfollow everyone if desired).
This will work for new Twitter web site code structure (it was changed from July 2019, causing other unfollow-scripts to stop working).
Instructions:
1) The code may need to be modified depending on the language of your Twitter web site:
* For English language web site, no modification needed.
* For Spanish language web site, remember to set the 'LANGUAGE' variable to "ES".
* For another language, remember to set the 'LANGUAGE' variable to that language and modify the 'WORDS' object to add the words in that language.
@sibelius
sibelius / reactLearningPath.md
Created May 24, 2021 01:28
React Learning Path
  • What is React props?
  • What is React state?
  • unidirectional data flow
  • how to create a React component
  • React hooks (useState, useEffect, and other basics ones)
  • Effects
  • How to handle event handlers (onClick)
  • React Context - share state for a subtree
  • Recoiljs
  • How to refactor a class component to hooks
@andrebrait
andrebrait / keychron_linux.md
Last active July 20, 2024 21:06
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@twalk4821
twalk4821 / datatables-custom-filter-demo.markdown
Last active April 5, 2021 11:51
DataTables Custom Filter Demo
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 23, 2024 06:43
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@dunossauro
dunossauro / get_data.py
Created December 5, 2016 01:35
Script que gera cpfs aleatórios e traz dados do SUS
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from random import randint
from requests import get
from json import loads
url = 'http://dabsistemas.saude.gov.br/sistemas/sadab/js/buscar_cpf_dbpessoa.json.php?cpf='
saida = 'N: {5}\nNome: {0}\nMãe: {1}\nSexo: {2}\nNacimento: {3}\nCPF: {4}'
@jh00nbr
jh00nbr / cpf_consulta_api_sus.py
Last active May 17, 2023 17:36
Script simples para consulta de dados na base dados nacional do SUS utilizando o CPF.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests,json,sys
# Script simples para consulta de dados na base dados nacional do SUS utilizando o CPF.
# Jhonathan Davi A.K.A jh00nbr / Insightl4b lab.insightsecurity.com.br
# jh00nbr: http://jhonathandavi.com.br
# Blog: lab.insightsecurity.com.br
# Github: github.com/jh00nbr
# Twitter @jh00nbr
@sarathlal-old
sarathlal-old / transfer-copy.php
Created July 29, 2015 10:01
Transfer files from server to server using PHP `copy()` function.
<?php
// Insert this file on server and go to the path from browser.
set_time_limit(0); //Unlimited max execution time
/* Source File URL */
$remote_file_url = 'http://origin-server-url/files.zip';
/* New file name and path for this file */
$local_file = 'files.zip';