Skip to content

Instantly share code, notes, and snippets.

View chathudan's full-sized avatar

Chathura Wijesinghe chathudan

View GitHub Profile
@chathudan
chathudan / GitTips.md
Last active August 29, 2015 14:19
Git Tips

create a new git branch from an old commit

This will create the new branch and check it out.

git checkout -b development a9c146a09505837ec03b

This development the branch without checking it out.

git branch development a9c146a09505837ec03b

Rollback to an old commit using

public static class TrustedSSLSocketFactory extends SSLSocketFactory {
SSLContext sslContext = SSLContext.getInstance("TLS");
public TrustedSSLSocketFactory(KeyStore truststore)
throws NoSuchAlgorithmException, KeyManagementException,
KeyStoreException, UnrecoverableKeyException {
super(truststore);
TrustManager tm = new X509TrustManager() {
public void checkClientTrusted(X509Certificate[] chain,
@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');
@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 / 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 / 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

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 / 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

@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 / TurnServerInstallationDocumentation.md
Last active April 4, 2020 11:55
Turn Server Installation Documentation

Turn Server Installation Documentation

change the package according to your server

wget http://turnserver.open-sys.org/downloads/v3.2.4.4/turnserver-3.2.4.4-debian-wheezy-ubuntu-
mint-x86-64bits.tar.gz

tar -zxvf turnserver-3.2.4.4-debian-wheezy-ubuntu-mint-x86-64bits.tar.gz

wget http://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz