Skip to content

Instantly share code, notes, and snippets.

@MichaelLawton
MichaelLawton / deleteAmazonSavedItems.js
Last active April 24, 2024 19:06
Removes all Amazon saved for later items on the cart page. It will only remove visible items. You might want to scroll first to make more items visible. To use paste code in developer console (Ctrl+Shift+J or Cmd+Opt+J in Chrome) then press enter.
function deleteSavedItems() {
var query = document.querySelectorAll("#sc-saved-cart input[value=Delete]")
if (query.length) {
query[0].click();
}
if (query.length > 1) {
setTimeout(deleteSavedItems,100);
}
else {
console.log('Finished');
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active April 24, 2024 19:05
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@iwek
iwek / csv-to-json.js
Last active April 24, 2024 19:05
CSV to JSON Conversion in JavaScript
//var csv is the CSV file with headers
function csvJSON(csv){
var lines=csv.split("\n");
var result = [];
var headers=lines[0].split(",");
for(var i=1;i<lines.length;i++){
@inspiretk
inspiretk / Wordpress server setup Ubuntu 18.04 Nginx
Last active April 24, 2024 19:05
Wordpress Ubuntu 18.04 Nginx
install PHPMyAdmin on Nginx Ubuntu 18.04
https://youtu.be/pGc8DbJVupE How to Install Nginx, PHP, MySQL (LEMP) on Ubuntu 18.04
sudo apt update && sudo apt install nginx -y
sudo service nginx status
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx HTTP'
sudo ufw enable
sudo ufw status
check ngix is working, go load your website up, has default ngix page
sudo apt update && sudo apt install mysql-server -y
@fuxingloh
fuxingloh / Data.java
Created April 17, 2020 07:36
Selectively Patch Data with Jackson ObjectMapper in Spring Web & Spring Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@Entity
public class Data {
@NotNull
@Id
@Column(length = 255, updatable = false, nullable = false, unique = true)
private String id;
@FBruzzesi
FBruzzesi / pydata-amsterdam-2023.ipynb
Created September 11, 2023 13:30
"Bayesian ranking for tennis players in PyMC" talk at PyData Amsterdam 2023
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leocomelli
leocomelli / git.md
Last active April 24, 2024 19:00
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@ardakazanci
ardakazanci / Bar.kt
Created April 24, 2024 15:49
Bar with JetpackCompose
data class BarDataM(val value: Float, val label: String)
@Composable
fun BarChartComponent(
bars: List<BarDataM>,
barWidth: Dp,
spaceBetweenBars: Dp,
animateChart: Boolean
) {
var selectedBar by remember { mutableIntStateOf(-1) }
@krisleech
krisleech / 00-NOTES.md
Last active April 24, 2024 19:02
Notes on Clojure ring handlers and middleware

Ring handler a function which accepts a request (map) and returns a response (map).

Ring middleware

function (handler, &args -> function(request -> response) because it is a closure handler and &args are in scope within the returned handler function.

a function which accepts a "next handler" (the next handler in the chain) + any extra arguments and returns a handler (function), which will accept a request and return a response.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 24, 2024 18:56
Complete Recent Discord Quest

Complete Recent Discord Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;