Skip to content

Instantly share code, notes, and snippets.

View umstek's full-sized avatar
🏠
Working from home

Wickramaranga Abeygunawardhana umstek

🏠
Working from home
View GitHub Profile
@jorcelinojunior
jorcelinojunior / cursor_appimage_manager.sh
Last active November 12, 2024 18:18
Automate the integration of Cursor .AppImage on Linux: updates .desktop, manages icons, ensures the latest version, and configures AppArmor (Required for Ubuntu 24.04).
#!/bin/bash
set -euo pipefail
# Definition of colors for terminal output
readonly RED_COLOR="\e[31m"
readonly GREEN_COLOR="\e[32m"
readonly YELLOW_COLOR="\e[33m"
readonly BLUE_COLOR="\e[34m"
readonly MAGENTA_COLOR="\e[35m"
@IliaMManolov
IliaMManolov / Cursor-Desktop-Linux-x64-Installer-Updater.sh
Last active November 3, 2024 11:42
This script can download and update the Cursor.sh text editor in Linux on x64 systems. You might need to have an `Applications` folder inside your `$HOME` to work. This is very unstable and can break at any time if the Cursor devs change the download links of some stuff.
#!/bin/bash
readonly RED_COLOR="\e[31m"
readonly GREEN_COLOR="\e[32m"
readonly YELLOW_COLOR="\e[33m"
readonly RESET_COLOR="\e[0m"
readonly APP_DIR="$HOME/Applications"
readonly ICON_DIR="$HOME/.local/share/icons"
readonly ICON_URL="https://cursor.sh/brand/icon.svg"
@Voldrix
Voldrix / animated_thumbnail_gen.sh
Last active August 2, 2023 09:26
Create animated thumbnail with ffmpeg in bash
#!/bin/bash
#Creates an animated thumbnail of a video clip
#This script uses scene cuts instead of fixed time intervals, and does not work well for videos with few/infrequent scene cuts
if [ -z "$1" ];then echo "Usage: <Video Files...> [outputs to same dir as input]" &>2;exit 1;fi
numOfScenes=8 #max number of scenes
sceneLength=1.5 #length of each scene in seconds
sceneDelay=1.7 #time (seconds) after a frame cut to start scene (to avoid transition effects)
for i;do
@FedericoPonzi
FedericoPonzi / CI.yml
Last active May 4, 2024 07:19
Ready to use Github workflow for cross-compiling a rust binary to many Linux architectures.
# Instruction + template repo: https://github.com/FedericoPonzi/rust-ci
# Search and replace <YOUR_BINARY_NAME> with your binary name.
name: CI
on:
pull_request:
push:
branches:
- master
tags:
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active November 5, 2024 12:03
Online Resources For Web Developers (No Downloading)
@primaryobjects
primaryobjects / m3u8.md
Last active November 12, 2024 18:28
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@hediet
hediet / main.md
Last active November 13, 2024 17:23
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active October 8, 2024 15:46
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
@0xjac
0xjac / private_fork.md
Last active November 15, 2024 13:06
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@ohac
ohac / Dockerfile
Created October 7, 2016 14:49
WebTorrent Hybrid Container example
FROM node
RUN apt-get update && \
apt-get install -y xvfb libgtk2.0-0 libxtst-dev libxss-dev libgconf2-dev \
libnss3 libasound2-dev && \
apt-get clean
RUN npm install webtorrent-hybrid -g
RUN mkdir work
WORKDIR work
CMD webtorrent-hybrid download \
e14cef00945a8d99dc74d65cf52dcb892cf48ed1 \