Skip to content

Instantly share code, notes, and snippets.

Nirmal Lanka nirlanka

  • Embla Software Innovation
  • Chilaw/Mount-Lavinia/Peradeniya, Sri Lanka
Block or report user

Report or block nirlanka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nirlanka
nirlanka / minimal-test.cs
Last active Nov 16, 2019
SublimeText3 CSharp runner and builder for Linux and OS X using installed Mono development environment
View minimal-test.cs
using System;
class Test
{
static void Main()
{
Console.WriteLine("Hello Sublime");
}
}
@nirlanka
nirlanka / html-structure.html
Created Oct 17, 2019
Add this style to any web page's header through dev-tools to see the structure of the layout.
View html-structure.html
<style>body * { background-color: rgba(0,0,100, .2) !important; outline: rgba(0,100,0, .2) !important; }</style>
@nirlanka
nirlanka / lisp-like.js
Last active Sep 14, 2019
A simple lisp-like language/interpreter written in pure javascript, using javascript arrays, without any dependencies. UPDATE: I'll be continuing work on this repository: https://github.com/nirlanka/ao
View lisp-like.js
(function () {
const __inp = `
((defun foo (a b)
(* a b))
(print (foo 2 3))
(defun bar (a b c) (foo
(foo a b)
c))
(print (bar 4 5 6))
@nirlanka
nirlanka / password-cracker.py
Created Aug 7, 2019
Answer to Hackerrank challenge "Password Cracker", which is correct, but not the expected answer in some test cases ¯\_(ツ)_/¯ (https://www.hackerrank.com/challenges/password-cracker/forum)
View password-cracker.py
#!/bin/python3
DEBUG = False
import math
import os
import random
import re
import sys
View hackerrank-contacts.py
#!/bin/python3
DEBUG = False
import os
import sys
def trie_find(node, path):
if not node.get(path[0]):
return 0
@nirlanka
nirlanka / create-angular-light.sh
Last active Jul 25, 2019
Create quick light Angular project
View create-angular-light.sh
$appname="one"
ng new $appname --prefix=$appname --enableIvy=true --inlineStyle=true --inlineTemplate=true --skipTests=true --routing=true --skipInstall=true --style=sass
@nirlanka
nirlanka / install-apps.ps1
Last active Jul 13, 2019
Install dev-env for MicroBuild
View install-apps.ps1
# Install Chrome
choco install googlechrome -y
# Install Slack
choco install slack -y
# Install other packages
choco install nvm -y
# Install NodeJS
@nirlanka
nirlanka / extract-packages.py
Created Jul 5, 2019
Extract package details from .NET or NodeJS projects
View extract-packages.py
## Usage:
## python(3) .\extract-packages.py filename.ext::filename2.ext
import sys
import subprocess
import json
import requests
def log(txt, line_end='\n'):
outfile = open('extract-packages.log.txt', 'a')
@nirlanka
nirlanka / click-to-copy-cell.js
Created May 13, 2019
Click to copy text (from table cell) in HTML with pure Javascript
View click-to-copy-cell.js
const copyToClipboard = str => {
const el = document.createElement('textarea');
el.value = str;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
};
document.addEventListener('click', (e) => {
@nirlanka
nirlanka / mobileconfig.json
Created Apr 9, 2019
MicroBuild Management Mobile - test 1
View mobileconfig.json
{
"//0.0.1": "http://localhost:59659/",
"0.0.1": "http://192.168.137.1:59659/"
}
You can’t perform that action at this time.