Skip to content

Instantly share code, notes, and snippets.

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

XieJiSS XieJiSS

🏠
Working from home
View GitHub Profile
@ZenithalHourlyRate
ZenithalHourlyRate / GUD.md
Last active July 19, 2024 19:43
Use old phone as a second display: USB GUD with postmarketOS

Demo

Xiaomi Redmi 2 with resolution 1280x720 (GUD RGB565 with compression)

9.mp4
10.mp4

@leoleoasd
leoleoasd / psql.sty
Last active November 30, 2021 06:45
Run psql and capture it's output from LaTeX.
\ProvidesPackage{psql}
\RequirePackage{minted}
\RequirePackage{fancyvrb}
\RequirePackage{tcolorbox}
\def\run{\FV@Environment{}{run}}
\def\FVB@run{%
\@bsphack
\begingroup
\FV@UseKeyValues
\FV@DefineWhiteSpace
@XieJiSS
XieJiSS / emoji-strip-browser.js
Last active February 27, 2023 21:40
To strip all emoji(s) from texts.
// generated with emoji-strip-node.js
// ref https://unicode.org/Public/emoji/12.1/emoji-data.txt
const emojiRegex = /©|®|‼|⁉|™|ℹ|[↔-↙]|↩|↪|⌚|⌛|⌨|⏏|[⏩-⏳]|[⏸-⏺]|Ⓜ|▪|▫|▶|◀|[◻-◾]|[☀-☄]|☎|☑|☔|☕|☘|☝|☠|☢|☣|☦|☪|☮|☯|[☸-☺]|♀|♂|[♈-♓]|♟|♠|♣|♥|♦|♨|♻|♾|♿|[⚒-⚔]|⚕|⚖|⚗|⚙|⚛|⚜|⚠|⚡|⚪|⚫|⚰|⚱|⚽|⚾|⛄|⛅|⛈|⛎|⛏|⛑|⛓|⛔|⛩|⛪|[⛰-⛵]|[⛷-⛺]|⛽|✂|✅|[✈-✍]|✏|✒|✔|✖|✝|✡|✨|✳|✴|❄|❇|❌|❎|[❓-❕]|❗|❣|❤|[➕-➗]|➡|➰|➿|⤴|⤵|[⬅-⬇]|⬛|⬜|⭐|⭕|〰|〽|㊗|㊙|\u{1F004}|\u{1F0CF}|\u{1F170}|\u{1F171}|\u{1F17E}|\u{1F17F}|\u{1F18E}|[\u{1F191}-\u{1F19A}]|[\u{1F1E6}-\u{1F1FF}]|\u{1F201}|\u{1F202}|\u{1F21A}|\u{1F22F}|[\u{1F232}-\u{1F23A}]|\u{1F250}|\u{1F251}|[\u{1F300}-\u{1F321}]|[\u{1F324}-\u{1F393}]|\u{1F396}|\u{1F397}|[\u{1F399}-\u{1F39B}]|[\u{1F39E}-\u{1F3F0}]|[\u{1F3F3}-\u{1F3F5}]|[\u{1F3F7}-\u{1F4FD}]|[\u{1F4FF}-\u{1F53D}]|[\u{1F549}-\u{1F54E}]|[\u{1F550}-\u{1F567}]|\u{1F56F}|\u{1F570}|[\u{1F573}-\u{1F579}]|\u{1F57A}|\u{1F587}|[\u{1F58A}-\u{1F58D}]|\u{1F590}|\u{1F595}|\u{1F596}|\u{1F5A4}|\u{1F5A5}|\u{1F5A8}|\u{1F5B1}|\u{1F5B2}|\u{1F5BC}|[\u{1F5C2}-\u{1F5C4}]|[\u{1F5D1}-\u{1F5D
@keithpotter21
keithpotter21 / test.js
Created May 18, 2018 05:16
Setup selenium-webdriver with chrome options to change download directory.
var webdriver = require('selenium-webdriver'),
chromeDriver = require('selenium-webdriver/chrome'),
By = require('selenium-webdriver').By,
until = require('selenium-webdriver').until;
var options = new chromeDriver.Options();
options.addArguments('start-maximized');
options.addArguments('incognito');
options.setUserPreferences({'download.default_directory' : '/path/to/your/download/directory'});
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active September 23, 2024 07:54
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@Manouchehri
Manouchehri / ieee754.js
Created October 13, 2017 19:00 — forked from bartaz/gist:1119041
Convert JavaScript number to string of 64bit double precision floating point representation (IEEE 754)
// Convert a JavaScript number to IEEE-754 Double Precision
// value represented as an array of 8 bytes (octets)
//
// http://cautionsingularityahead.blogspot.com/2010/04/javascript-and-ieee754-redux.html
function toIEEE754(v, ebits, fbits) {
var bias = (1 << (ebits - 1)) - 1;
// Compute sign, exponent, fraction
@anandsunderraman
anandsunderraman / setChromeOptions.js
Last active July 19, 2024 12:13
Selenium Web Driver Set Chrome Options
//import the selenium web driver
var webdriver = require('selenium-webdriver');
var chromeCapabilities = webdriver.Capabilities.chrome();
//setting chrome options to start the browser fully maximized
var chromeOptions = {
'args': ['--test-type', '--start-maximized']
};
chromeCapabilities.set('chromeOptions', chromeOptions);
var driver = new webdriver.Builder().withCapabilities(chromeCapabilities).build();
@bartaz
bartaz / gist:1119041
Created August 1, 2011 21:22
Convert JavaScript number to string of 64bit double precision floating point representation (IEEE 754)
// Convert a JavaScript number to IEEE-754 Double Precision
// value represented as an array of 8 bytes (octets)
//
// http://cautionsingularityahead.blogspot.com/2010/04/javascript-and-ieee754-redux.html
function toIEEE754(v, ebits, fbits) {
var bias = (1 << (ebits - 1)) - 1;
// Compute sign, exponent, fraction