Skip to content

Instantly share code, notes, and snippets.

View aashutoshrathi's full-sized avatar
👨‍💻
Baking Code

Aashutosh Rathi aashutoshrathi

👨‍💻
Baking Code
View GitHub Profile
@aashutoshrathi
aashutoshrathi / SETUP.md
Created February 14, 2024 17:36
Setup new Mac

🆕 💻 Mac Setup List:

  • all dotfiles
  • install brew, node zsh, python
  • sudo-touchid
  • iTerm config
  • Fonts with ligatures
  • Raycast
  • Wallpapers
  • Use Stacks on Desktop
  • git's ssh & gpg setup
@aashutoshrathi
aashutoshrathi / _no_code_page_.php
Created March 13, 2023 09:55 — forked from Dan-Q/_no_code_page_.php
Hacky PHP to produce a "blank" web page which somehow has content when viewed in Firefox. Sample page at https://danq.me/wp-content/no-code-webpage/, explanation at https://danq.me/nocode
<?php
// half-hearted CSS minification
$css = preg_replace(
array('/\s*(\w)\s*{\s*/','/\s*(\S*:)(\s*)([^;]*)(\s|\n)*;(\n|\s)*/','/\n/','/\s*}\s*/'),
array('$1{ ','$1$3;',"",'} '),
file_get_contents('linked.css')
);
// embed as a data: uri
$base64css = rtrim(strtr(base64_encode($css), '+/', '-_'), '=');
@aashutoshrathi
aashutoshrathi / standup-bot.js
Created January 31, 2023 20:42
Sample Slack Standup Bot for getting order
// add a cronjob for this
import fetch from 'node-fetch'; // for lower node versions
const getOrder = () => {
const users = ["Jim", "Pam" "Dwight"]; // names of users
let shuffled = users
.map(value => ({ value, sort: Math.random() }))
.sort((a, b) => a.sort - b.sort)
.map(({ value }) => `-> ${value}`);
@aashutoshrathi
aashutoshrathi / mongo-set-nal.js
Last active January 16, 2023 19:02
Adds or updates your current IP to NAL Whitelisting for Mongo
const sleep = (milliseconds) => {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
};
const YOUR_ENTRY_NAME = "Aashutosh";
// Go to NAL Page
if (window.location.hash !== "#/security/network/accessList") {
window.location.hash = "#/security/network/accessList";
await sleep(1000);
}
def unicodetoascii(text):
TEXT = (text.
replace('\\xe2\\x80\\x99', "'").
replace('\\xc3\\xa9', 'e').
replace('\\xe2\\x80\\x90', '-').
replace('\\xe2\\x80\\x91', '-').
replace('\\xe2\\x80\\x92', '-').
replace('\\xe2\\x80\\x93', '-').
replace('\\xe2\\x80\\x94', '-').
@aashutoshrathi
aashutoshrathi / build.gradle
Created June 26, 2021 09:33
Force Same Version Code/ Build Number to all variant APKs using Flutter
android {
...
}
// Add the below code in android/app/build.gradle after above android block
// Provide same version code to all!
import com.android.build.OutputFile
android.applicationVariants.all { variant ->
@aashutoshrathi
aashutoshrathi / clearClutter.js
Created July 9, 2020 14:10
Clears the new x/x repository cards from GitHub Feed
x = document.querySelectorAll('div.f4.lh-condensed.text-bold.text-gray-dark');
for(let i=0; i<x.length; i++) {
const [a, b] = x[i].children[0].innerText.split('/');
if(a === b)
x[i].parentElement.parentElement.remove();
}
@aashutoshrathi
aashutoshrathi / aashutoshrathi.md
Last active July 18, 2020 06:25
Rough trials of Bio

Hey nerd, I'm Aashutosh! 👋🏻

Twitter Badge Stackoverflow Badge Linkedin Badge Gmail Badge

  • 🔭 I’m currently working on a product ([Electron + React] 📦 ) with @mohitkyadav.
  • 🌱 I’m currently learning Gra
@aashutoshrathi
aashutoshrathi / getActualType.js
Last active March 14, 2020 11:44
Get Actual Type In JS
const getActualType = weirdo =>
toString
.call(weirdo)
.match(/([A-Z])\w+/)[0]
.toLowerCase();
// toString.call(T) returns "[Object <TypeOfT>]", I find the first word with Capital Letter as front.

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example