Skip to content

Instantly share code, notes, and snippets.

View mitramejia's full-sized avatar

Mitra Mejia mitramejia

View GitHub Profile
@mitramejia
mitramejia / vimium-theme-macos.css
Last active December 13, 2021 14:09
Vimium Mac OS Theme
:root {
--font-size: 14.5;
--font-size-hints: 12.5;
--font-size-url: 12.5;
--font-weight: normal;
--font-weight-medium: medium;
--font-weight-bold: bold;
--font: "SF UI Display", "Helvetica", "Arial", sans-serif; /* Font used in the UI */
@mitramejia
mitramejia / .hyper.js
Created December 11, 2021 19:45
Hyperterm config
//
@mitramejia
mitramejia / two-sum.js
Created August 13, 2020 15:10
Two Sum
/**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
var twoSum = function(nums, target) {
//hash table
var hash = {};
const moneyFilter = value => Intl.NumberFormat('en-IN', { style: 'currency', currency: 'USD' }).format(value)
console.log(moneyFilter(3210)) // "US$ 3,210.00"
@mitramejia
mitramejia / react-typescript.md
Created April 17, 2018 13:11 — forked from juhaelee/react-typescript.md
React + Typescript Cheatsheet

React + Typescript Cheatsheet

Setup

If you use atom... download & install the following packages:

What are Typescript type definition files? (*.d.ts)

@mitramejia
mitramejia / steps.md
Created March 29, 2018 18:16 — forked from travisvalentine/steps.md
Setup Facebook app to test authentication locally (aka, setting up App Domain)

Note: I had issues with setting up my Facebook app so authentication would work. I'd receive the error at the bottom, and it took me a while to figure out what was wrong

Here are the steps I took:

  • Go to http://developers.facebook.com/, create, and setup your app
  • When inside the dashboard, click "Settings"
  • Click "Add Platform"
  • Choose website (for authentication via the web app)
  • Add http://localhost:3000/ as "Site URL" (and "Mobile URL" if necessary)
  • Add localhost to "App Domains" above
@mitramejia
mitramejia / gist:a1a6546b84cadf68e5944b0879407930
Created March 12, 2018 16:38
Some times we need to add a full width containers (which spans 100% of window) inside a container which has a fixed width and aligned center
<div class="container" style="width: 750px; margin: 0 auto;">
<div class="row-full">
--- Full width container ---
</div>
</div>
.row-full{
@mitramejia
mitramejia / example.sass
Created March 8, 2018 16:18 — forked from brod-ie/example.sass
respond-to() SASS mixin for Bootstrap 3 grid system.
.profile-pic {
float: left;
width: 250px;
@include respond-to(xs) {
width: 100%;
}
@include respond-to(sm) {
width: 125px;
}
@mitramejia
mitramejia / mitracoin.js
Last active January 19, 2018 20:19
Simple Blockchain made with JS
const SHA256 = require('crypto-js/sha256');
class Block {
constructor(index, timestamp, data, previousHash = ''){
this.index = index;
this.timestamp = timestamp;
this.data = data;
this.previousHash = previousHash;
this.hash = this.calculateHash();
this.nonce = 0;
@mitramejia
mitramejia / random-number-between-two.scss
Created April 3, 2017 17:43
Get a random number between two numbers in scss
// Given two numbers return the biggest one
@function get-biggest-num-between($a, $b) {
$c: null;
@if ($a > $b) {
$c : $a;
}
@if ($a < $b) {
$c : $b;
}
@else if ($a = $b){