Skip to content

Instantly share code, notes, and snippets.

View piyush1104's full-sized avatar
:octocat:

Piyush Bansal piyush1104

:octocat:
View GitHub Profile
@piyush1104
piyush1104 / .php_cs.dist
Last active May 17, 2020 07:08 — forked from Billz95/.php_cs.dist
A Customised fixer for PHP-CS-Fixer to use `prettier`'s php plugin to pre-process the code before getting analysed by other fixers. This would enable `php-cs-fixer` to take advantage of `prettier`'s ability of managing long line.
<?php
require_once __DIR__.'/PrettierPHPFixer.php';
$finder = PhpCsFixer\Finder::create()
->exclude('somedir')
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php')
->in(__DIR__)
;
@piyush1104
piyush1104 / README.md
Created November 13, 2020 08:32 — forked from int128/README.md
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.

@piyush1104
piyush1104 / 1.js
Created February 11, 2021 17:23 — forked from jakearchibald/1.js
export function animationInterval(ms, signal, callback) {
const start = document.timeline.currentTime;
function frame(time) {
if (signal.aborted) return;
callback(time);
scheduleFrame(time);
}
function scheduleFrame(time) {
@piyush1104
piyush1104 / osx_defaults.sh
Created June 15, 2021 06:34 — forked from vraravam/osx-defaults.sh
OSX Defaults to setup a brand new machine
#!/usr/bin/env bash
# TODO: Need to figure out the settings for the following:
# 1) Dock: Items with order (not capturing binary data - since that is dependent on installed apps)
# 2) Security & Privacy Preferences: Full Disk Access, Camera, Microphone
# 3) Login items for my user (i.e. apps started when I login)
# 4) Retina displays scaling
# 5) Finder sidebar with order
##
@piyush1104
piyush1104 / WSLWindows10Setup.md
Created August 22, 2021 06:09 — forked from AjkayAlan/WSLWindows10Setup.md
Windows SubSystem For Linux setup that I like with some developers stuff mixed in

Setting Up WSL

Install A Distro:

  1. Run the following in powershell as admin Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

  2. Install a distro (ex: Ubuntu 18.04 LTS - https://www.microsoft.com/store/apps/9N9TNGVNDL3Q)

  3. Open your distro you installed via the start menu, let it setup

  4. Update and upgrade

sudo apt-get update
@piyush1104
piyush1104 / install-xcode-command-line-tools.sh
Created September 30, 2021 16:17 — forked from phuctm97/install-xcode-command-line-tools.sh
🔨 Install Xcode Command Line Tools and wait until it's done
#!/bin/bash
# Install XCode Command Line Tools.
xcode-select --install &> /dev/null
# Wait until XCode Command Line Tools installation has finished.
until $(xcode-select --print-path &> /dev/null); do
sleep 5;
done
@piyush1104
piyush1104 / iterm2.md
Created September 28, 2023 09:23 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)