Skip to content

Instantly share code, notes, and snippets.

@ryancdavison
ryancdavison / iPad-Pro-Magic-Keyboard-Portrait-Mode-DIY-Smart-Connector-Cable.md
Last active May 8, 2024 12:40
iPad Pro 12.9 (2020) Magic Keyboard Portrait Mode DIY Smart Connector Cable

iPad Pro 12.9" (2020) Magic Keyboard Portrait Mode DIY Smart Connector Cable

I wanted my iPad Pro to be able to use the Magic Keyboard in portrait mode, but the current Smart Connector configuration does not allow this. With too much time on my hands, I made a short jumper cable using a section of USB cable, 5-pin POGO connectors (the 5-pin works using pins 1, 3, and 5, and removing pins 2 and 4), a small electrical project box, 3mm N52 magnets, and some epoxy and Sugru to pack everything into place. My cable and connections orientation had more to do with the boxes I found to encase the connector (with holes on the small end) than anything else. Obviously, there will be many ways to do this.

WARNING: Getting any of these steps wrong will probably ruin your iPad.

Note: These measurements are for the 12.9" (2020) model. The magnets did not line up and the polarity was different for my wife's iPad Pro 11" (2021).

![iPad-Pro-MmagicKeyboard-Jumper-Cable-min](https://user-images.githubusercontent.c

@karoltheguy
karoltheguy / forloop.bat
Last active May 8, 2024 12:40
Batch file for loop csv
@for /F "tokens=1,2,3 skip=1 delims=," %%A in (test.txt) do (
@echo I am at %%A using login %%B:%%C
)
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@ibrahimsn98
ibrahimsn98 / jwt-expiration.md
Created February 8, 2019 13:18 — forked from soulmachine/jwt-expiration.md
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@vasanthk
vasanthk / System Design.md
Last active May 8, 2024 12:37
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@nickcernis
nickcernis / mariadb-brew-macos.md
Created July 13, 2020 15:13
Install MariaDB with brew on macOS and fix the “access denied” issue

Attempting mysql -u root fails with Access denied for user 'root'@'localhost immediately after doing brew install mariadb and starting mariadb with brew services start mariadb.

To fix it (with MariaDB still running):

  1. sudo mysql then enter your Mac user password
  2. ALTER USER 'root'@'localhost' IDENTIFIED BY 'newrootpassword'; replacing newrootpassword with the password you wish to use for the MariaDB root user.
  3. Ctrl-C to exit mysql.

You should then be able to connect to MariaDB with mysql -u root -p, then entering the root password when prompted.

@josh-padnick
josh-padnick / download.sh
Last active May 8, 2024 12:37
Download a private binary release file from GitHub in bash
#!/usr/bin/env bash
#
# This is an adaptation of code I wrote to download a private binary from GitHub. Such...pain.
# Why can't GitHub just offer a standardized URL you can download a release binary from and attach
# your Github Personal Access Token as a header?
#
# Since this code is an adaptation it hasn't been directly tested, but the code it was adapted from works
# and hopefully you can get the missing piece you're after by looking here.
#
\n
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
\n
@v1mkss
v1mkss / JetBrains Activation.md
Last active May 8, 2024 12:33
JetBrains Activation

Choose any IDE from Jetbrains, then the activation window opens, go to the “Proxy Settings” and paste the following:

  • Manual proxy configuration http:
    • Hostname: localhost
    • port: 80
  • No proxy for:
*.apache.org, *.github.com, *.github.io, *.githubusercontent.com, *.gitlab.com, *.google.com, *.gradle.org, *.jetbrains.space, *.maven.org, cache-redirector.jetbrains.com, cloudconfig.jetbrains.com, download-cdn.jetbrains.com, download.jetbrains.com, downloads.marketplace.jetbrains.com, ea-report.jetbrains.com, github.com, gitlab.com, google.com, gradle.org, jcenter.bintray.com, plugins.jetbrains.com, resources.jetbrains.com, www.jetbrains.com

Activation Key:

@gabe565
gabe565 / change-arc-icon.md
Last active May 8, 2024 12:33
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy