Skip to content

Instantly share code, notes, and snippets.

@mahavir1408
mahavir1408 / index.html
Created November 25, 2020 10:42
LitElement Example
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script>
</head>
<body>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
<script type="module">
import {LitElement, html, css} from 'https://unpkg.com/lit-element/lit-element.js?module';
@mahavir1408
mahavir1408 / index.html
Created November 25, 2020 10:30
LitElement Example
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script>
</head>
<body>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
<script type="module">
import {LitElement, html, css} from 'https://unpkg.com/lit-element/lit-element.js?module';
@mahavir1408
mahavir1408 / index.html
Created November 25, 2020 08:40
LitElement Example
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script>
</head>
<body>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
<script type="module">
import {LitElement, html, css} from 'https://unpkg.com/lit-element/lit-element.js?module';
@mahavir1408
mahavir1408 / index.html
Created November 25, 2020 08:08
LitElement Example
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script>
<style>
.title {
background: red;
padding: 16px;
color: #ffffff;
}
@mahavir1408
mahavir1408 / index.html
Created November 25, 2020 07:34
LitElement Example
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script>
</head>
<body>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
<script type="module">
import {LitElement, html, css} from 'https://unpkg.com/lit-element/lit-element.js?module';
@mahavir1408
mahavir1408 / index.html
Created November 25, 2020 07:31
LitElement Example
<html>
<head>
<!-- Polyfills only needed for Firefox and Edge. -->
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@latest/webcomponents-loader.js"></script>
</head>
<body>
<!-- Works only on browsers that support Javascript modules like
Chrome, Safari, Firefox 60, Edge 17 -->
<script type="module">
import {LitElement, html, css} from 'https://unpkg.com/lit-element/lit-element.js?module';

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
process.stdin.resume();
process.stdin.setEncoding('utf8');
// declare global variables
var input_stdin = "";
var chunks = "";
var input_currentline = 0;
// standard input is stored into input_stdin
process.stdin.on('data', function (data) {
@mahavir1408
mahavir1408 / candies.js
Created January 30, 2017 12:54
candies distributiion problem
process.stdin.resume();
process.stdin.setEncoding('utf8');
// declare global variables
var input_stdin = "";
var chunks = "";
var input_currentline = 0;
// standard input is stored into input_stdin
process.stdin.on('data', function (data) {
@mahavir1408
mahavir1408 / encode-decode.js
Created June 1, 2016 08:44
Encode and Decode using base64
var crypto = require('crypto');
var password = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
//var encodeStr = 'deepak2717%deepak2717#e1';
//var decodeStr = 'eJbhbDXy54yBfSWj41Z_up7K6gtq_fcBfcR_biDdhCk=';
var encodeStr = '100%yqa_alpha1';
var decodeStr = 'wz18E33BUCCvfp+vo8dtv4EOrG8OydPTl6OKs8QC1Z0=';
var encrypt = function (input, password, callback) {
var m = crypto.createHash('md5');