Skip to content

Instantly share code, notes, and snippets.

@RubyTuesdayDONO
RubyTuesdayDONO / gist:5006455
Last active May 15, 2024 22:22 — forked from six8/gist:1732686
logic revisions to pass test case
// Dependency resolution, adapted from https://gist.github.com/1232505/f16308bc14966c8d003c2686b1c258ec41303c1f
function resolve(graph) {
var sorted = [], // sorted list of IDs ( returned value )
visited = {}; // hash: id of already visited node => true
// 2. topological sort
Object.keys(graph).forEach(function visit(name, ancestors) {
if (!Array.isArray(ancestors)) ancestors = [];
ancestors.push(name);
visited[name] = true;
@beci
beci / aur_speed_up.md
Last active May 15, 2024 22:21
Speed up compiling of AUR packages in arch linux

Edit /etc/makepkg.conf

replace in CFLAGS and CXXFLAGS to use the native one

-march=x86-64 -mtune=generic to -march=native

speed up build by set multiple threads

MAKEFLAGS="-j$(nproc)"

@bMinaise
bMinaise / Boilerplate CSS Media Queries
Created September 5, 2013 18:17
CSS Media Queries Boilerplate
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-width : 320px)
and (max-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@ixahmedxi
ixahmedxi / keybindings.json
Created January 2, 2024 20:46
Vscode neovim keybindings.json
[
{
"command": "vscode-neovim.compositeEscape1",
"key": "j",
"when": "neovim.mode == insert && editorTextFocus",
"args": "j"
},
{
"command": "vscode-neovim.compositeEscape2",
"key": "k",
@ixahmedxi
ixahmedxi / eslint.config.js
Created May 15, 2024 17:24
ESLint v9 Next.js
import path from 'path';
import { fileURLToPath } from 'url';
import comments from '@eslint-community/eslint-plugin-eslint-comments/configs';
import { fixupConfigRules } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import jsdoc from 'eslint-plugin-jsdoc';
import * as regexpPlugin from 'eslint-plugin-regexp';
Mix.install(
[
{:phoenix_playground, "~> 0.1.0"},
{:openai, "~> 0.6.1"}
],
config: [
openai: [
api_key: System.get_env("OPENAI_API_KEY"),
organization_key: System.get_env("OPENAI_ORGANIZATION_KEY")
]
@flaksp
flaksp / README.md
Last active May 15, 2024 22:14
Convert BitWarden JSON export file to Apple iCloud Keychain CSV import file saving TOTP and notes

BitWarden to Apple iCloud Keychain passwords converter

This Python scripts allows you to move your passwords from BitWarden to Apple iCloud.

You need to know:

  • It ignores secure notes, credit cards and other types that are not passwords.
  • It ignores BitWarden entries without usernames, passwords and URLs.
  • It also ignores URLs that do not start with http:// or https://.
  • It normalizes all TOTP tokens, e.g. wskg vtqa h5kl bhb4 v4v2 ybyo woc6 qme2 will be converted to otpauth://totp/example.com:dude@foo.bar?secret=WSKGVTQAH5KLBHB4V4V2YBYOWOC6QME2&issuer=example.com&algorithm=SHA1&digits=6&period=30.
@VitorBlog
VitorBlog / Debian_Discord_Updater_README.md
Last active May 15, 2024 22:11
Debian discord updater

Debian Discord Updater

Keeping your Discord client up-to-date is now hassle-free with this simple updater script.

Usage

Just execute the script, and it will handle the update process seamlessly.

Setting Up Automatic Updates

To ensure Discord update on boot, follow these steps:

  1. Open the crontab file using the command:
@b3h3rkz
b3h3rkz / faucets.md
Last active May 15, 2024 22:17
Bitcoin Testnet Faucets