Skip to content

Instantly share code, notes, and snippets.

View rohannair's full-sized avatar
🤖

Rohan Nair rohannair

🤖
View GitHub Profile
@rohannair
rohannair / nodejs-shell.nix
Created July 19, 2022 02:12
NodeJS + Nix shell
let pkgs = import <nixpkgs> {};
in pkgs.mkShell rec {
name = "nodejs";
buildInputs = with pkgs; [
gnumake
gcc
readline
openssl
@rohannair
rohannair / elixir-phoenix-postgres-shell.nix
Last active July 20, 2022 22:05
Elixir / Phoenix + Postgres shell.nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
inherit (lib) optional optionals;
elixir = beam.packages.erlangR24.elixir_1_13;
nodejs = nodejs-16_x;
postgresql = postgresql_14;
@rohannair
rohannair / better-font-smoothing.css
Created May 2, 2018 18:25 — forked from hsleonis/better-font-smoothing.css
Better font smoothing in cross browser
html {
/* Adjust font size */
font-size: 100%;
-webkit-text-size-adjust: 100%;
/* Font varient */
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;

Keybase proof

I hereby claim:

  • I am rohannair on github.
  • I am rohan_10 (https://keybase.io/rohan_10) on keybase.
  • I have a public key ASBN6sWAWHNcxn5Bzp0PKX7uCGOF-8OIyBzw2ZFJZxQCSwo

To claim this, I am signing this object:

@rohannair
rohannair / testtesttest.md
Last active September 1, 2017 17:54
Pungle Tech Screen test

Pungle Tech screening test!

Intro

Thanks for your interest in Pungle! Our technical interview process involves candidates doing an at-home (or at work, or at Starbucks) project to test your reasoning and problem solving abilities, while also giving the candidate a chance to write code in a way that is comfortable for them. Once the screening test is submitted, our team will go over the answers and invite promising candidates into our work space for an in-person technical, where we will go over the technical decisions made in the test!

This test should take about 2 hours. If you take less time, no problem! If you take more time, that's cool too but don't spend more than 3 hours working on this. Using Google/StackOverflow/TorontoJS/whatever for help is allowed, but ultimately you should write and be able to justify every piece of the code being submitted.

Directions

  • Answer any 2 of the 3 options below. Each question is testing knowledge in different libraries/domains.
  • If you have any questions at

CSS is growing up

anigif_enhanced-buzz-9050-1400007899-16.gif

About 4 years ago I was trying to figure out whether to use LESS or Sass. I could use Codekit or even switch to Espresso to get automatic compilation and updates!

We ended up using LESS, but for the life of me I couldn't tell you why. A bit later Grunt and Gulp came out to make things even easier. Somehow during this time I switched to Scss, and didn't really look back.

This represented a huge step forward in dealing with CSS. We could nest selectors, split them into smaller files, use variables, use mixins! It was amazing and made life a ton easier.

Learning Javascript

Disclaimer: this is pretty stream-of-consciousness and was written pretty quickly. I'll clarify it over time, as I get feedback on parts that are confusing.

If you're TOTALLY new to Javascript, use my article as a companion to Codecademy's Javascript Introduction

I taught myself Javascript. By that I mean, I muddled through it for a few years until I realized that I could probably make myself more employable if actually figured how to do more complicated things.

Since I never understood the foundations of JS, I always found myself frustrated because my code wouldn't work as I expected. Mainly, I was used to jQuery API, and didn't quite grasp that the language was more complicated than $('div').something().

/**
* Middleware for Drift, allowing user identification
*/
import { LOAD_USER_DETAILS } from '../constants/auth.constants';
const drift = window.drift ? window.drift : () => {};
const driftLogger = store => next => action => {
if (action.type === LOAD_USER_DETAILS) {

Stu Sept 15th Mission Briefing

Mission Objective:

  • Implement the Welcome Kit UI, based off the mockups

Mission Duration

  • 2 weeks

Measureable Objectives

  • Build a React-ified UI
  • Implement State Management via Redux and React-Redux bindings
const randomNumber = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;