Skip to content

Instantly share code, notes, and snippets.

View parambirs's full-sized avatar
👋

Parambir Singh parambirs

👋
View GitHub Profile
@parambirs
parambirs / app.js
Created September 7, 2019 23:26
Basic Vue Application
const app = new Vue({
el: '#app',
data: {
product: 'Boots',
myproducts: [
'Boots',
'Jacket',
'Hiking Socks'
],
products: []
@parambirs
parambirs / JavaStreams.java
Created August 29, 2019 19:56
Creating different kinds of Stream sources in Java
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class Sources {
public static void main(String[] args) throws IOException {
@parambirs
parambirs / Switch.java
Created August 29, 2019 19:55
Java 12 Switch
public class Main {
enum Event {
PLAY, STOP, PAUSE
}
public static void main(String[] args) {
var event = Event.PLAY;
switch (event) {
case PLAY:
@parambirs
parambirs / docker.sh
Created August 15, 2019 20:27
Docker Postgres
docker pull postgres:latest
docker run -d --name guitar-db -p 5432:5432 -e 'POSTGRES_PASSWORD=p@ssw0rd42' postgres
@parambirs
parambirs / ScalaJS.md
Last active December 4, 2018 23:20
Scala.js notes

sbt tasks

> run

> fastOptJS

Generates a single JS file.

> fullOptJS

@parambirs
parambirs / setup.sh
Created October 10, 2018 19:48
TypeScript Node Express Setup
npm init -y
npm install --save typescript
tsc --init
@parambirs
parambirs / singleton.js
Created June 26, 2018 20:01
Singleton in JavaScript
'use strict';
let lime = new function() {
this.type = 'Mexican lime';
this.color = 'green';
this.getInformation = function() {
return 'This ' + this.type + ' is ' + this.color + '.';
};
}
@parambirs
parambirs / isSafeInteger.js
Created June 25, 2018 19:22
isSafeInteger() method in Number
Number.isSafeInteger(3.4); // false
Number.isSafeInteger(3); // true
@parambirs
parambirs / vimtutor.txt
Last active January 23, 2017 02:27
Vim Tutor Summary
Lesson 1 SUMMARY
1. The cursor is moved using either the arrow keys or the hjkl keys.
h (left) j (down) k (up) l (right)
2. To start Vim from the shell prompt type: vim FILENAME <ENTER>
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
OR type: <ESC> :wq <ENTER> to save the changes.
@parambirs
parambirs / hipchat.sh
Last active October 15, 2016 10:54
Creating hipchat addons in node.js
$ npm install -g atlas-connect
# Create new hipchat addon project with a template
$ atlas-connect new -t hipchat my-first-hipchat-addon
$ ngrok http 3000
$ redis-server
$ heroku create psingh-hipchat-hello