Skip to content

Instantly share code, notes, and snippets.

View 0x61nas's full-sized avatar
🥺
in stand by mode

0x61nas

🥺
in stand by mode
View GitHub Profile
// cc -w -include time.h -o qlock qlock.c // MIT Copyright (c) Tsoding
char*s="// cc -w -include time.h -o qlock qlock.c // MIT Copyright (c) Tsoding\n"
"char*s=\"?\";x,y,d[8],i,dx;f[]={31599,19812,14479,31207,23524,29411,29679,\n"
"30866,31727,31719,1040};char*so,*si;p(ch){i=x/2/(3+2);dx=x/2%(3+2);if(i<8&&(y-5)\n"
"/2<5&&dx<3&&(f[d[i]]>>((5-(y-5)/2-1)*3+dx))&1)printf(\"\\033[1;41;30m%c\\033[0m\",ch\n"
");else printf(\"%c\",ch);if(ch=='\\n'){y+=1;x=0;}else x+=1;}gd(){time_t t=time(NULL);struct\n"
" tm*tm=localtime(&t);d[0]=tm->tm_hour/10;d[1]=tm->tm_hour%10;d[2]=10;d[3]=tm->tm_min\n"
"/10;d[4]=tm->tm_min%10;d[5]=10;d[6]=tm->tm_sec/10;d[7]=tm->tm_sec%10;}main(){for\n"
"(gd();;printf(\"\\n\\033[%dA\\033[%dD\",y+1,x),sleep(1),gd())for(so=s,x=0,y=0;*so;so++\n"
")if(*so==63)for(si=s;*si;si++)switch(*si){case'\\n':p('\\\\');p('n');p('\"');p('\\n')\n"
function shrink_path {
# Replace the home directory with ~ for brevity
local path="${PWD/#$HOME/~}"
local new_path=""
local -a path_components=("${(@s:/:)path}")
local num_components=${#path_components[@]}
# Loop through each component except the last one
for (( i=1; i < num_components; i++ )); do
if [[ -n ${path_components[i]} ]]; then
new_path+="%{$fg[yellow]%}${path_components[i][1]}%{$reset_color%}%{$fg[white]%}:%{$reset_color%}"
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active February 27, 2025 22:50
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This does not works in browser for non-video, non-activity quests! For stream/play quests use the desktop app!

Note

When doing stream quests, you need at least 1 other account in the vc!

How to use this script:

  1. Accept a quest under Discover -> Quests
@adtac
adtac / Dockerfile
Last active February 28, 2025 02:18
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@body20002
body20002 / base.html
Last active August 22, 2022 18:36
FJPT Stack (FastAPI + Jinja2 + Preact + tailwindcss)
<!doctype html>
<html>
<head>
{% block head %}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="{{ url_for('static', path='css/style.css') }}" rel="stylesheet">
<title>{% block title %}
{{ '%s | Your Name' % title or 'Your Name' }}
{% endblock %}
@SanariSan
SanariSan / readme.md
Last active November 25, 2024 03:47
Telegram HTTP bot API via CURL | Send text, photos, documents, etc.

Here are some examples on how to use Telegram bot api via CURL

Prerequisites

For getting messages in private chat with bot

  • Create a bot using @BotFather, get it's token
  • Start conversation with bot
  • Run following curl command
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
@orhun
orhun / arch_linux_installation.md
Last active February 14, 2025 03:59
Notes on my Arch Linux installation: UEFI/Secure Boot + systemd-boot, LUKS-encrypted root (XFS), LUKS-encrypted swap (with hibernate & unlocked via TPM)
@orhun
orhun / Arch_Linux_Packaging.md
Last active February 26, 2024 23:43
Custom guide for managing Arch Linux packages

Packaging for Arch Linux

Requirements

@Zekfad
Zekfad / conventional-commits.md
Last active February 26, 2025 19:55
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries