Skip to content

Instantly share code, notes, and snippets.

@vaibhav-s
vaibhav-s / gh-pages-deploy.md
Created November 17, 2022 23:30 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@vaibhav-s
vaibhav-s / on-jsx.markdown
Created July 19, 2022 00:28 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@vaibhav-s
vaibhav-s / web-servers.md
Created July 1, 2022 01:56 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@vaibhav-s
vaibhav-s / README.md
Created March 22, 2022 20:21 — forked from necolas/README.md
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name
@vaibhav-s
vaibhav-s / angular_code_review.md
Last active January 31, 2022 21:39 — forked from blakewest/angular_code_review.md
Angular Code Review Checklist

Analysis and Design activities Decide on UI structure, if the new feature creates a module. Decide on components to be built by category of presentational or container components. Decide on redux state activities to be performed Decide on redux actions, reducers, effects.

Coding rules Any additional npm package, utility or pattern to be implemented must be discussed in the team for a review. UI structure adheres to accepted Angular project guidelines. UI State management pattern should be implemented as per redux state management guidelines.

@vaibhav-s
vaibhav-s / README.txt
Created January 11, 2022 18:39 — forked from julkue/README.txt
Example of HTML import with Shadow DOM (isolated CSS)
1. Install e.g. http-server globally (https://www.npmjs.com/package/http-server)
2. Run http-server in this folder
3. Open http://localhost:8080/ in Chrome (there are polyfills available to make it work in other browsers too)
@vaibhav-s
vaibhav-s / The Technical Interview Cheat Sheet.md
Created September 28, 2018 00:56 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@vaibhav-s
vaibhav-s / latency.txt
Created March 10, 2017 02:47 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@vaibhav-s
vaibhav-s / latency.txt
Last active March 10, 2017 02:48 — forked from jboner/latency.txt
Latency Numbers
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD