Skip to content

Instantly share code, notes, and snippets.

View tmkasun's full-sized avatar

Kasun Thennakoon tmkasun

View GitHub Profile
Beneboe /
Last active June 18, 2024 17:16
How to Setup Verified Commits on Github
sebmarkbage / The
Last active June 30, 2024 01:30
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

tmkasun /
Last active October 17, 2019 09:02
Setup APIM server and Run it with it's depending servers, Will only be useful until API manager product properly pack the dependencies in to final product. Till we get there ...
#! /usr/bin/env bash
# HOW TO USE: Put this file inside the directory where you would like to extract and run the product-APIM build file (.zip file)
# Change the below path variables accordingly *** NOTE: No trailing `/` slashes has been used
# This will only work with APIM 3.0.0 latest version with Carbon 4.x kernel. Addition to coping and unziping the pack,
# This script will only create symbolic links to the carbon-apimgt repository files.
volkancakil /
Last active October 12, 2022 14:59
How to install GNU Global 6.5.6 on Ubuntu 16.10
echo " ...."
echo "install package for GNU global..."
sudo apt-get update
sudo apt-get -y install curl
sudo apt-get -y install wget
sudo apt-get -y install ncurses-dev
benkulbertis /
Last active July 24, 2024 10:20
Cloudflare API v4 Dynamic DNS Update in Bash
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
ip=$(curl -s
rozifus / Python SimpleHTTPServer with SSL
Last active October 9, 2022 22:40
Python SimpleHTTPServer with SSL
# useful for running ssl server on localhost
# which in turn is useful for working with WebSocket Secure (wss)
# copied from
debasishg / gist:b4df1648d3f1776abdff
Last active January 20, 2021 12:15
another attempt to organize my ML readings ..
  1. Feature Learning
  1. Deep Learning
imesh /
Created December 26, 2013 14:31
Copy CEP artifacts from source to server deployment folders
# -----------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
mrrooijen / run.rb
Created May 28, 2013 17:05
Quick `open3` wrapper for running a synchronous system command and returning the pid, exit_status, stdout and stderr of the provided command.
require "open3"
def run(cmd)
Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
return {
exit_status: wait_thr.value.to_i,
creativeaura /
Created May 9, 2013 10:34
Modifying Python's SimpleHTTPServer to accept directory aliases
import os
import posixpath
import urllib
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
# modify this to add additional routes
# [url_prefix , directory_path]
['/media', '/var/www/media'],