Skip to content

Instantly share code, notes, and snippets.

View airstrike's full-sized avatar
🎯
bringing presentations and spreadsheets to the 21st century

Andy airstrike

🎯
bringing presentations and spreadsheets to the 21st century
View GitHub Profile
@htruong
htruong / template.js
Last active July 26, 2021 05:20
Zenreader server
export default (title, content) => `
<html>
<head>
<title>${title}</title>
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/combine/npm/purecss@2.0.3/build/base-min.css,npm/purecss@2.0.3/build/grids-min.css,npm/purecss@2.0.3/build/forms-min.css"
/>
<style>
img {
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active December 19, 2024 19:13
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@ctsrc
ctsrc / .gitignore
Last active February 19, 2024 01:55
Random dungeon generator from https://news.ycombinator.com/item?id=19309378, deobfuscated, refactored and commented
/.idea/
/cmake-build-debug/
/dungeon
@munificent
munificent / generate.c
Last active September 15, 2024 03:16
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@airstrike
airstrike / .vimrc
Last active October 13, 2020 03:39
Latest vimrc file (2019)
" VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set so=2 " Show at least 2 lines around cursors when moving vertically
set ruler "Always show current position
set cmdheight=1 "The commandbar height
" Set backspace config
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
@airstrike
airstrike / anne.ahk
Created July 25, 2018 20:56
Anne Pro AutoHotkey (AHK) Script
SetCapsLockState, AlwaysOff
; The above lets you use hotkeys at the bottom end of the file on keyboards other than Anne and emulate the Fn Caps behavior
Menu, Tray, Icon, %A_WorkingDir%\anne.ico,, 1
<+J::Send, +{Left}
<+K::Send, +{Down}
<+L::Send, +{Right}
<+I::Send, +{Up}
<+#J::Send, +#{Left}
@ivanbrennan
ivanbrennan / show-256-colors.sh
Last active October 25, 2024 18:03
Use Bash to show all 256 colors supported by xterms
#!/usr/bin/env bash
PADDING='Padding'
main() {
local xterm_start=0 \
xterm_width=8 \
xterm_height=2
local cube_start=$((xterm_start + xterm_width * xterm_height)) \
@HiImJulien
HiImJulien / Swift Meets CCxx.md
Last active November 30, 2024 06:10
This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.

Swift Meets C/C++

This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.


In this example we're going to invoke a function called say_hello, which, as the name already suggests, prints "Hello, World!" to the terminal.

@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active December 17, 2024 02:20
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.