Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Chamuth Chamandana Thilakarathne Chamuth

🏠
Working from home
Block or report user

Report or block Chamuth

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
@Chamuth
Chamuth / drupal-views-share-global-text-field
Created Jun 10, 2017 — forked from chrisjlee/drupal-views-share-global-text-field
share url's for facebook, twitter, pinterest with just get variables
View drupal-views-share-global-text-field
<ul>
<li class="share-text">Share this>/li>
<li class="share-tw"><a href="http://twitter.com/share?text=[title]"><span></span></a></li>
<li class="share-fb"><a href="http://www.facebook.com/sharer.php?u=/node/[nid]&p=[title]"><span></span></a></li>
<li class="share-pinterest"><a href="http://pinterest.com/pin/create/button/?url=/node/[nid]&description=[title]"><span></span></a></li>
</ul>
@Chamuth
Chamuth / 0_reuse_code.js
Created Jul 6, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\SPT\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm@6.4.1
3 info using node@v8.10.0
4 verbose npm-session 2003944f504d7f47
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall traveller@1.0.0
7 info lifecycle traveller@1.0.0~preinstall: traveller@1.0.0
@Chamuth
Chamuth / lkphones.ts
Created Nov 21, 2018
Validate Sri Lankan phones numbers and get their carrier
View lkphones.ts
export module LKPhoneValidator
{
export function Validate(phone : string) : PhoneValidation
{
// remove starting +94
phone = phone.replace("+94", "0");
// Consider number length
if ((phone.startsWith('0') && phone.length == 10) || (!phone.startsWith('0') && phone.length == 9) && /^\d+$/.test(phone))
{
You can’t perform that action at this time.