Skip to content

Instantly share code, notes, and snippets.

View farskid's full-sized avatar
🎯
Focusing

Farzad Yousefzadeh farskid

🎯
Focusing
View GitHub Profile
@farskid
farskid / listVariables.js
Created January 17, 2020 15:03
List all global variables (custom props added to window object)
const iframeEl = document.createElement('iframe');
document.body.appendChild(iframeEl);
console.log(Object.keys(window).filter(key => !(key in iframeEl.contentWindow)));
@farskid
farskid / bash.sh
Created January 11, 2020 17:32
Watch Youtube videos while working, on Mac OS, in Pic-on-Pic mode
npx ytdl --print-url [YTB_URL] | npx open-pip-cli
@farskid
farskid / index.js
Last active November 15, 2019 09:33
Speaking statecharts
const statechart2 = {
id: "zoneMachine",
initial: "preparing",
context: {
error: undefined,
zone: undefined
},
states: {
preparing: {
invoke: {
@farskid
farskid / machine.js
Created November 2, 2019 08:48
Generated by XState Viz: https://xstate.js.org/viz, single input model
Machine({
initial: "ready",
context: {
value: ""
},
states: {
updating: {
entry: "updateInputValue",
on: {
'': [
@farskid
farskid / machine.js
Last active November 1, 2019 19:06
Modeling Netflix login form using statecharts
function validateEmail(email) {
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
}
function validatePassword(password) {
return password.length >= 5 && password.length < 60;
}
@farskid
farskid / .bashrc
Last active February 25, 2021 11:18
Mac settings and extensions (Read `Notes.md` before using any of files)
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
function fuzzy_open() {
code $(fd $1)
}
@farskid
farskid / machine.js
Last active September 12, 2019 14:44
HSLZone logic using Finite state machines and Reactive statecharts
const zoneMachine = Machine(
{
id: "zoneMachine",
initial: "preparing",
context: { error: undefined, zone: undefined },
states: {
preparing: {
invoke: {
src: "detectLocationSupport",
id: "detectLocationSupport",
@farskid
farskid / parse_dotenv.bash
Created August 19, 2019 08:45 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)

I bundled these up into groups and wrote some thoughts about why I ask them!

If these helped you, I'd love to hear about it!! I'm on twitter @vcarl_ or send me an email [email protected]

Onboarding and the workplace

https://blog.vcarl.com/interview-questions-onboarding-workplace/

  • How long will it take to deploy my first change? To become productive? To understand the codebase?
  • What kind of equipment will I be provided? Will the company pay/reimburse me if I want something specific?
@farskid
farskid / remove_tuxera.sh
Last active June 13, 2019 19:40 — forked from miguelmota/remove_tuxera.sh
Completely uninstall and remove Tuxera NTFS on MacOS (resets trial version)
sudo rm -rf /Applications/Tuxera\ Disk\ Manager.app
sudo rm -rf /Library/Application\ Support/Tuxera\ NTFS
sudo rm -rf /Library/Filesystems/fusefs_txantfs.fs
sudo rm -rf /Library/Filesystems/tuxera_ntfs.fs