Skip to content

Instantly share code, notes, and snippets.

View PcFerreira's full-sized avatar
:shipit:
Focusing

Pedro (はク) PcFerreira

:shipit:
Focusing
View GitHub Profile
@zoilomora
zoilomora / README.md
Last active April 25, 2024 08:17
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@mig1098
mig1098 / javascript_unicode.html
Last active February 27, 2024 21:18
javascript unicode accents
Question: Can I display accented characters or ligatures as part of JavaScript output?
Answer: You can include accented characters and ligatures in JavaScript strings and/or display them on your HTML pages using the following encodings for the letters:
hexadecimal codes \xXX in JavaScript strings; e.g. ñ is \xF1
Unicode hex codes \uXXXX in JavaScript strings; e.g. š is \u0161
HTML entities; for example, ñ is ñ and š is š
numeric HTML entities; e.g. ñ is ñ and š is š
unescape with a suitable argument; e.g. ñ is unescape('%F1')
decodeURI with a suitable argument; e.g. ñ is decodeURI('%C3%B1')
@virolea
virolea / upload.js
Last active March 15, 2024 13:45
Tracking file upload progress using axios
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 12, 2024 01:58
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@eeaslan
eeaslan / Arduino_Uno_Digital_Port_Control_SW.ino
Created May 6, 2014 06:08
This software is the Arduino Uno firmware of a project called "Arduino Uno Port Control". The aim of this project is to control the digital I/O pins of Arduino Uno from an Android device. The android app can be downloaded from Google Play Store.
byte lineEnding = 0x0A;
//Data array that the received info from android app is recorded. Every byte corresponds to a digital pin.
byte readBuffer[15]; //For example readBuffer[5] is for digital pin 5.
byte defaultByte = 0x10; //On start all arduino digital pins must be input for electrical protection.
//Pins 0 and 1 are used for serial comminations. So read
void setup() {
for (int i=0; i < sizeof(readBuffer)-1 ; ++i) {
@willurd
willurd / web-servers.md
Last active May 13, 2024 01:24
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@letanure
letanure / estados-cidades.json
Last active April 30, 2024 23:07
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",