Skip to content

Instantly share code, notes, and snippets.

Avatar

Tomy Ismail tomysmile

  • NITOZA
  • Dubai
View GitHub Profile
@tomysmile
tomysmile / list.component.ts
Last active Nov 28, 2020
how to disable and prevent selection on root node in devexpress treelist (angular)
View list.component.ts
onCellPrepared(e) {
if (
e.rowType === "data" &&
e.column.visibleIndex === 0 &&
e.value === "ROOT"
) {
const el = e.cellElement as HTMLElement;
const ck = el.getElementsByClassName("dx-select-checkbox")[0];
const instance = dxCheckBox.getInstance(ck);
@tomysmile
tomysmile / init.d
Created Jun 1, 2020
mongodb init.d for debian linux
View init.d
#!/bin/sh
#
# init.d script with LSB support.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
@tomysmile
tomysmile / Docker shell commands.sh
Created Jan 20, 2019 — forked from bahmutov/Docker shell commands.sh
A personal cheat sheet for running local Node project in a Docker container
View Docker shell commands.sh
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .
View docker-compose.yml
version: '2'
volumes:
mongo_data:
cassandra_data:
services:
kong:
image: kong:latest
depends_on:
@tomysmile
tomysmile / installing_cassandra.md
Created Dec 17, 2018 — forked from hkhamm/installing_cassandra.md
Installing Cassandra on Mac OS X
View installing_cassandra.md

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@tomysmile
tomysmile / mac-apps.md
Created Feb 26, 2018 — forked from erikreagan/mac-apps.md
Mac developer must-haves
View mac-apps.md

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@tomysmile
tomysmile / random.js
Created Jan 22, 2018 — forked from kerimdzhanov/random.js
JavaScript: get a random number from a specific range
View random.js
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
@tomysmile
tomysmile / client.js
Created Jan 22, 2018 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
View client.js
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@tomysmile
tomysmile / BackgroundGeolocation-Ionic2.js
Created Dec 29, 2017 — forked from christocracy/BackgroundGeolocation-Ionic2.js
Simple Cordova Background Geolocation Implementation for Ionic 2
View BackgroundGeolocation-Ionic2.js
/**
* How to implement cordova-background-geolocation with Ionic 2
* https://github.com/transistorsoft/cordova-background-geolocation-lt
* Chris Scott, Transistor Software <chris@transistorsoft.com>
*/
import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
@tomysmile
tomysmile / Java.md
Created May 18, 2017 — forked from JeOam/Java.md
Install Java 8 on OS X
View Java.md

on El Capitan, after installing the brew...

$ brew update
$ brew tap caskroom/cask
$ brew install Caskroom/cask/java

And Java 8 will be installed at /Library/Java/JavaVirtualMachines/jdk1.8.xxx.jdk/

Check version: