Skip to content

Instantly share code, notes, and snippets.

@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active May 2, 2024 21:29
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.

@krisbolton
krisbolton / fix-USB-showing-up-as-two-partitions.md
Last active May 2, 2024 21:29
How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows

How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows:

  1. Hold the Windows key and press X, select PowerShell (Admin), select Yes to the pop-up. You can also use Command Prompt.
  2. In the Powershell interface type diskpart to enter the disk partition tool.
  3. Type list disk to see all disks listed.
  4. Select the USB drive by typing select disk [NUMBER]. Be careful to select the correct drive.
  5. Type clean. An error will occur if you have the drive folder open, close the window and repeat the command if this happens.
  6. Type create partition primary.
  7. Type format fs=ntfs quick to format the drive (you can also choose to set fs=fat32).
  8. Type active.
@mcastelino
mcastelino / iptables-cheatsheet.md
Last active May 2, 2024 21:27
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@stellasphere
stellasphere / descriptions.json
Last active May 2, 2024 21:25
WMO weather interpretation code descriptions (& images)
{
"0":{
"day":{
"description":"Sunny",
"image":"http://openweathermap.org/img/wn/01d@2x.png"
},
"night":{
"description":"Clear",
"image":"http://openweathermap.org/img/wn/01n@2x.png"
}
@c0ldlimit
c0ldlimit / git_newrepo
Created November 16, 2012 17:14
Git: Push a new or existing repo to Github
# Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line
@gornostal
gornostal / README.md
Last active May 2, 2024 21:24
Ulauncher Color Themes

This will be a temporary site for sharing Ulauncher color themes

When posting a theme make sure it has

  • title (theme name or whatever)
  • link to a gist or github repo with theme files
  • screenshot attached (just drag an image onto a comment area)

@brookst
brookst / fs5000.py
Last active May 2, 2024 21:24
Serial interface to Bosean FS-5000 radiation detector
#!/usr/bin/env python3
__author__ = "Tim Brooks"
__email__ = "brooks@skoorb.net"
__date__ = "2024-04-23"
import datetime
from enum import Enum, Flag
import logging
import serial
import serial.tools.list_ports as list_ports
@JoeyBurzynski
JoeyBurzynski / Homebrew_How-to-Backup-and-Restore-Homebrew-Packages-2022.md
Last active May 2, 2024 21:24
Homebrew: How to Backup & Restore Homebrew Packages [2022, MacOS]

Homebrew: How to Backup & Restore Homebrew Packages

Homebrew makes it easy to install and keep installed software up to date on your Mac - as part of my backup routine for my Mac I want to be able to run a single command to reinstall all packages.

If you're searching on how to backup & restore Homebrew, then I assume you're here for the commands.

Brewfiles

Brewfiles are files generated with definitions that Homebrew reads and processes, a generated

@mmozeiko
mmozeiko / !README.md
Last active May 2, 2024 21:22
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone 64-bit MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for 64-bit native desktop app development.

Run python.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.32.17.2 and v10.0.22621.0.

You can list available versions with python.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe from output folder, first run setup.bat - after that PATH/INCLUDE/LIB env variables will be setup to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@SandroMaglione
SandroMaglione / File.ts
Created May 1, 2024 20:56
File upload validation service created using `effect` only
import { Brand, Context, Data, Effect, Layer } from "effect";
type FileMetadata = Readonly<{ type: string; size: number }>;
export type ValidFile = FileMetadata & Brand.Brand<"ValidFile">;
const ValidFile = Brand.nominal<ValidFile>();
class FileTooLargeError extends Data.TaggedError("FileTooLargeError")<
Readonly<{ size: number }>
> {}