Skip to content

Instantly share code, notes, and snippets.

View iamandrewluca's full-sized avatar
🚨
Git Inspector!

Andrei Luca iamandrewluca

🚨
Git Inspector!
View GitHub Profile
@iamandrewluca
iamandrewluca / programming-language-expert-system.pro
Created December 18, 2015 07:07
Expert system for advising a programming language. (GNU Prolog)
% ------------------------------------------------------------------------------
% Generic Expert System interface
% ------------------------------------------------------------------------------
% Dynamic fact
% --------------------------------------
:- dynamic(known/3).
% --------------------------------------
% Start system
% --------------------------------------
solve :-
@iamandrewluca
iamandrewluca / git-emails.sh
Created June 1, 2017 16:02
List all emails participated at a git repository with commits count
git log --format='%ae' | sort | uniq -c | sort -nr
@iamandrewluca
iamandrewluca / GameWon.png
Last active August 23, 2017 19:14
2nd year at Univeristy. Minesweeper in terminal. Made on windows, might work on *nix
GameWon.png
@iamandrewluca
iamandrewluca / event.code-to-ascii.js
Created July 11, 2018 14:19
Map any keyboard layout and keyboard entry to US layout
function getChar({ code, shiftKey }) {
if (code.startsWith('Key')) {
return code.replace('Key', '')
}
if (code.startsWith('Digit')) {
return code.replace('Digit', '')
}
const normal = {
@iamandrewluca
iamandrewluca / map-input.html
Last active July 17, 2018 10:59
Map input chars to another chars
<input type="text">
@iamandrewluca
iamandrewluca / top-commands.sh
Last active December 1, 2024 12:02
Show top 10 commands most used
history 1 | awk '{print $2}' | sort | uniq -ci | sort -gr | head -n 10
@iamandrewluca
iamandrewluca / oss-tools.md
Last active August 8, 2024 00:19
Open source software tools
@iamandrewluca
iamandrewluca / README.md
Last active August 6, 2019 15:58
Grep l10n labels from project
grep -rhosP "(?<=l10n\(\')([\w\.]+)(?=\'\))" src/
  • -r recursive in nested folders and files
  • -h don't show file names
  • -o print only matches
  • -s silent errors
  • -P activate advanced perl regex
  • (?&lt;=l10n\(\') must start with l10n(' but don't include in match
@iamandrewluca
iamandrewluca / headings-out-of-order.js
Last active June 29, 2020 17:55
Will outline headings out of order in a page (from https://twitter.com/Una/status/1277652897606635523) #bookmarklet
javascript: void ((function() {
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */
const styles = document.createTextNode(`
/* Headers out of order (i.e. h2 before h1, etc.) */
/* Result: dotted blue outline */
/* https://twitter.com/Una/status/1277652897606635523 */
h2 ~ h1,
h3 ~ h1,
h4 ~ h1,
h5 ~ h1,
@iamandrewluca
iamandrewluca / bookmarks-to-notion.js
Last active September 30, 2024 13:07
Export bookmarks to Notion as a Database
(function bookmarksExportToCsv() {
/**
* 1. Export bookmarks from browser (supported any Chromium based browsers and Safari) (chrome://bookmarks)
* 2. Open exported html file again in the browser
* 3. Copy paste this entire file in console, and execute it (hit enter)
* 4. You will be prompted to save a CSV file. Save it.
* 5. Open Notion. Click Import -> CSV
* 6. Select saved CSV file. Wait for import
* 7. You have a new database with all your bookmarks
*/