Skip to content

Instantly share code, notes, and snippets.

@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active April 24, 2024 19:11
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@quangIO
quangIO / wezterm.lua
Created March 15, 2022 15:08
My wezterm config with tmux-like bindings
local wezterm = require 'wezterm';
return {
color_scheme = "Dracula",
-- colors = {
-- background = "#0c0e14",
-- },
window_decorations = "NONE",
font = wezterm.font("Iosevka"),
font_size = 10.0,
-- dpi = 192.0,
#AwayFromKeyboardRev9#
{"version":1,"profile":{"commands":[{"path":"\/sys\/devices\/system\/cpu\/cpu3\/onlinechmod644","command":"chmod 644 \/sys\/devices\/system\/cpu\/cpu3\/online"},{"path":"\/sys\/devices\/system\/cpu\/cpu3\/online","command":"echo '1' > \/sys\/devices\/system\/cpu\/cpu3\/online"},{"path":"\/sys\/devices\/system\/cpu\/cpu3\/onlinechmod444","command":"chmod 444 \/sys\/devices\/system\/cpu\/cpu3\/online"},{"path":"\/sys\/devices\/system\/cpu\/cpu4\/onlinechmod644","command":"chmod 644 \/sys\/devices\/system\/cpu\/cpu4\/online"},{"path":"\/sys\/devices\/system\/cpu\/cpu4\/online","command":"echo '1' > \/sys\/devices\/system\/cpu\/cpu4\/online"},{"path":"\/sys\/devices\/system\/cpu\/cpu4\/onlinechmod444","command":"chmod 444 \/sys\/devices\/system\/cpu\/cpu4\/online"},{"path":"\/sys\/module\/workqueue\/parameters\/power_efficientchmod","command":"chmod 644 \/sys\/module\/workqueue\/parameters\/power_efficient"},{"path":"\/sys\/module\/workqueue\/parameters\/power_efficient","command":"echo 'N
@disler
disler / ADA_v2_README.md
Created April 17, 2024 18:01
Personal AI Assistant: 'Ada' - v0.2

This is not working complete code.

This is strictly a v0.2, scrapy, proof of concept version of a personal AI Assistant working end to end in just ~726 LOC.

This is the second iteration showcasing the two-way prompt aka multi-step human in the loop. The initial, v0, assistant version is here.

It's only a frame of reference for you to consume the core ideas of how to build a POC of a personal AI Assistant.

To see the high level of how this works check out the explanation video. To follow our agentic journey check out the @IndyDevDan channel.

@arshednabeel
arshednabeel / vicsek.py
Last active April 24, 2024 19:07
A minimal implementation of the Vicsek model in ~50 lines of code
import numpy as np
from tqdm import trange
def get_neighbour_matrix(x, L, R):
dx = np.subtract.outer(x[:, 0], x[:, 0])
dy = np.subtract.outer(x[:, 1], x[:, 1])
dx[dx > (L / 2) ** 2] -= (L / 2) ** 2
dy[dy > (L / 2) ** 2] -= (L / 2) ** 2
pair_dist = dx ** 2 + dy ** 2
@arshednabeel
arshednabeel / animate_flock.py
Created April 24, 2024 08:35
Animate collective movement of flocks from trajectories.
'''
A simple animation function to animate collective movement of flocks, given trajectory data.
(c) Arshed Nabeel, 2024
'''
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
@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