Skip to content

Instantly share code, notes, and snippets.

arvindr21 / input.scss
Created Nov 23, 2020
Generated by
View input.scss
/// @group fonts
/* Font family variations
************************* */
$font-family-swiss: Swiss-721;
$font-swiss: $font-family-swiss;
$font-swiss-condensed: SwissCondensed;
$font-marriotticons: MarriottIcons;
arvindr21 / angular.json
Created Aug 16, 2020 — forked from gsans/angular.json
Remove CommonJS or AMD dependencies optimization bailouts warnings for AWS Amplify using Angular v10
View angular.json
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"allowedCommonJsDependencies": ["crypto-js", "@aws-sdk/eventstream-marshaller", "buffer", "js-cookie",
"@aws-crypto", "zen-observable", "@aws-sdk/util-utf8-node", "@aws-crypto/sha256-js", "@aws-sdk/util-buffer-from",
"@aws-sdk/smithy-client", "@aws-sdk/middleware-serde", "@aws-sdk/middleware-user-agent",
"@aws-sdk/middleware-retry", "@aws-sdk/middleware-signing", "@aws-sdk/middleware-content-length",
"@aws-sdk/middleware-host-header", "@aws-sdk/config-resolver", "@aws-sdk/s3-request-presigner",
"@aws-sdk/util-format-url", "@aws-sdk/util-create-request", "@aws-sdk/property-provider",
# Inspects branch name and checks if it contains a Jira ticket number (i.e. ABC-123).
# If yes, commit message will be automatically prepended with [ABC-123].
# Useful for looking through git history and relating a commit or group of commits
# back to a user story.
View Reading configuration files before application startup in Angular2 final

Reading data before application startup in Angular 2

In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.

This is how the demonstration will load data:

a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';

b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.

View example-ajax-enqueue.php
function example_ajax_enqueue() {
// Enqueue javascript on the frontend.
get_template_directory_uri() . '/js/simple-ajax-example.js',
arvindr21 /
Created Oct 4, 2019 — forked from masak/
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry.

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <>
Date:   Sun Apr 15 16:35:03 2012 +0200

    When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.
arvindr21 / backends.js
Created Apr 23, 2019 — forked from kevinswiber/backends.js
Express Gateway Example with Multiple Services
View backends.js
const express = require('express');
const forum = express();
.get('/healthz', (req, res, next) => {
res.send({ name: 'forum', status: 'healthy' });
.get('/d/:id', (req, res, next) => {
arvindr21 /
Created Nov 15, 2018 — forked from agentcooper/
Telegram chat backup/export

How to use

  1. Login to
  2. Copy-paste contents of telegram-scripts.js into JS console
  3. Run showContacts() to get the list of contacts with ids
  4. Run saveChat(userId) where userId is the id from step 3

Process can take a while, check console for progress. Occasionall FLOOD_WAIT errors are expected. Once done, browser will download the JSON file.


arvindr21 / git-checkout-pr
Created Jul 5, 2018 — forked from mandrizzle/git-checkout-pr
Easily checkout pull requests locally from Atlassian Bitbucket Server (Stash)
View git-checkout-pr
# Usage: `git checkout-pr <pull-request-id>`
# Make this file executable and place in a $PATH directory
# The name of the file is important. It has to be named `git-checkout-pr` for the usage to be `git checkout-pr`
# Every pull request on stash has 2 branches. One is called `merge` which is a branch that is merged with its destination.
# The other is `from` which is the unmodified revision that was pushed. This script checks out the merge branch.
# If you want to checkout the pr that is not pre-merged with it's destination, change all occurances of `merge` to `from`
arvindr21 / object-watch.js
Created Jun 21, 2018 — forked from riddy/object-watch.js polyfill
View object-watch.js