Skip to content

Instantly share code, notes, and snippets.

View shroukkhan's full-sized avatar

Shrouk Hasan Khan shroukkhan

  • Softverk / Fingi / Thai-Fi
  • Bangkok
View GitHub Profile
Building mosquitto:
git clone git@github.com:eclipse/mosquitto.git
sudo apt-get install cmake libssl-dev
cd <MOSQUITTO_SRC>
wget https://github.com/warmcat/libwebsockets/archive/v2.1.0.tar.gz
tar -xzvf v2.1.0.tar.gz
cd libwebsockets-2.1.0/
mkdir build
cd build/
@rundef
rundef / merge-nyc-code-coverage-reports.js
Last active December 22, 2020 16:45
Script to merge multiple nyc/istanbul code coverage json reports into a single html report: http://rundef.com/typescript-code-coverage-istanbul-nyc
var path = require('path'),
fs = require('fs'),
libCoverage = require('nyc/node_modules/istanbul-lib-coverage'),
libReport = require('nyc/node_modules/istanbul-lib-report'),
reports = require('nyc/node_modules/istanbul-reports');
var rootFolder = __dirname;
var mergeIntoFolder = 'final';
var files = fs.readdirSync(rootFolder);
var mergedCoverageMap = null;
@nhagen
nhagen / PromisAllWithFails.js
Last active November 15, 2022 18:11
Wait until all promises have completed even when some reject, with Promise.all
var a = ["sdfdf", "http://oooooolol"],
handleNetErr = function(e) { return e };
Promise.all(fetch('sdfdsf').catch(handleNetErr), fetch('http://invalidurl').catch(handleNetErr))
.then(function(sdf, invalid) {
console.log(sdf, invalid) // [Response, TypeError]
})
.catch(function(err) {
console.log(err);
})
@shroukkhan
shroukkhan / renameAndBuild.sh
Last active April 13, 2016 06:58
this script will rename csipsimple and build fingi usage is simple, call it the same way you call build.sh no change is needed to your existing code. the script will automatically download csipsimple and actionbarsherlock if not found. put this scripp in your app (android_app ) folder ( same directory as build.sh) and call it like this: ./rename…
#!/bin/bash
############ check arguments #################
if [ -z "$1" ]
then
echo "No argument supplied, please provide product name and build type. such as: ./renameAndBuild.sh aloft debug "
exit
fi
############ setting paths #################
@shroukkhan
shroukkhan / renameCSipSimple
Created February 15, 2013 14:11
renaming csip simple package
mkdir src/com/fingi
mv src/com.fingi.csipsimple.src/com/fingi/
find src/ -type f -print0 | xargs -0 sed -i 's/com.csipsimple./com.fingi.csipsimple./g' *.java
find res/ -type f -print0 | xargs -0 sed -i 's/com.csipsimple./com.fingi.csipsimple./g' *.xml