Skip to content

Instantly share code, notes, and snippets.

View chathudan's full-sized avatar

Chathura Wijesinghe chathudan

View GitHub Profile
@chathudan
chathudan / MaterialDesignIconsFont.cs
Last active July 12, 2023 15:08
MAUI Rating View Control
namespace MauiControl.Rating;
internal class MaterialDesignIconsFont
{
public const string VectorSquare = "\U000f0001";
public const string AccessPointNetwork = "\U000f0002";
public const string AccessPoint = "\U000f0003";
public const string Account = "\U000f0004";
public const string AccountAlert = "\U000f0005";
public const string AccountBox = "\U000f0006";
@chathudan
chathudan / bright-v8-local.json
Created August 29, 2019 08:26 — forked from klokan/bright-v8-local.json
bright-v8-local.json
{
"version": 8,
"name": "Bright",
"sources": {
"mapbox": {
"url": "http://osm2vectortiles.tileserver.com/v1.json",
"type": "vector"
}
},
@chathudan
chathudan / GitCommands.md
Last active April 16, 2019 06:10
Useful Git Commands

Git Tag

  1. Checkout the tag (a Detached HEAD)

    git checkout tag/v1.1

  2. Create and Checkout a branch off that tag (i.e. Branching off the tag)

git checkout -b my-tagged-branch

Delete workspace builds

  1. Go to your Jenkins home page → Manage Jenkins → Script Console
  2. Run the following script there. Change JOB_NAME to your project name
def jobName = "JOB_NAME"
def job = Jenkins.instance.getItem(jobName)
@chathudan
chathudan / GoogleTranslate.json
Created February 12, 2019 08:12
Translate JSON structures using google translation API. " node GoogleTranslate YOUR_GOOGLE_API_KEY JSON_FILE.json fr,et,nl"
#!/usr/bin/env node
const fs = require('fs');
const moment = require('moment');
const _ = require('lodash');
const path = require('path');
const agent = require('superagent-promise')(require('superagent'), Promise);
//Lang Codes https://ctrlq.org/code/19899-google-translate-languages
@chathudan
chathudan / GoogleTranslate.json
Created February 12, 2019 08:12
Translate JSON structures using google translation API.
#!/usr/bin/env node
const fs = require('fs');
const moment = require('moment');
const _ = require('lodash');
const path = require('path');
const agent = require('superagent-promise')(require('superagent'), Promise);
//Lang Codes https://ctrlq.org/code/19899-google-translate-languages
@chathudan
chathudan / mediaqueries.css
Created January 24, 2019 07:04 — forked from needim/mediaqueries.css
Device Specific CSS Media Queries Collection
/*
Based on:
1. http://stephen.io/mediaqueries
2. https://css-tricks.com/snippets/css/media-queries-for-standard-devices/
*/
/* iPhone X in portrait & landscape */
@media only screen
and (min-device-width : 375px)
and (max-device-width : 812px)
@chathudan
chathudan / xpub-xsub.js
Created October 30, 2017 07:22 — forked from tjanczuk/xpub-xsub.js
How to connect 5 publishers with 5 subscribers over TCP using ZeroMQ's XPUB/XSUB proxy
// How to connect 5 publishers with 5 subscribers
// over TCP using ZeroMQ's XPUB/XSUB proxy.
// sub (connect)
// <-8701->
// (bind) xpub <---> xsub (bind)
// <-8700->
// (connect) pub
var zmq = require('zmq');

free -m to see memory statistics

df -h to see disk usage statistics

du -h --max-depth=1 | sort -hr

ls -ld .?* Will only list hidden files

ls -a List All Files

@chathudan
chathudan / BackupRestoreMySQLDatabase.md
Last active July 21, 2021 09:46
Back Up and Restore a MySQL Database

If you're storing anything in MySQL databases that you do not want to lose, it is very important to make regular backups of your data to protect it from loss. This tutorial will show you two easy ways to backup and restore the data in your MySQL database. You can also use this process to move your data to a new web server.

Back up From the Command Line (using mysqldump)

Back up your MySQL Database with Compress

Restoring your MySQL Database

Backing Up and Restoring using PHPMyAdmin