Skip to content

Instantly share code, notes, and snippets.

View khalilovcmd's full-sized avatar
🏠
Working from home

Tarek Khalil khalilovcmd

🏠
Working from home
View GitHub Profile
@khalilovcmd
khalilovcmd / hacker rank - depth first search (graph)
Created June 13, 2015 20:09
hacker rank - depth first search (graph)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace ConnectedCellGrid
{
class Program
{
@khalilovcmd
khalilovcmd / hacker rank - comparing two lists of numbers (finding the missing numbers in one list)
Created June 14, 2015 16:50
hacker rank - comparing two lists of numbers (finding the missing numbers in one list)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
// sample input
// 10
// 203 204 205 206 207 208 203 204 205 206
// 13
@khalilovcmd
khalilovcmd / Start-HDInsight-Services.ps1
Created October 1, 2015 04:42
Stopping HDInsight Emulator Services on Windows (Powershell)
$services = Get-Service -DisplayName Apache*
foreach ($i in $services)
{
Start-Service $i.ServiceName
}
@khalilovcmd
khalilovcmd / randomizer.cs
Last active September 22, 2022 10:24
Generate a number of random ascii characters in C#
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@khalilovcmd
khalilovcmd / python-pip-installation.sh
Last active December 9, 2015 11:13
Installing Python + Pip on debian
sudo apt-get install python-pip python-dev build-essential
sudo pip install --upgrade pip
@khalilovcmd
khalilovcmd / heroku-getting-started.sh
Last active December 9, 2015 11:12
installing heroku, and getting started
# download heroku
wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
# login to heroku
heroku login
# create heroku-git link (adding a heroku remote)
heroku create
# pushing a commit to heroku
@khalilovcmd
khalilovcmd / server-density.sh
Last active December 16, 2015 11:21
installing server density redis plugin on a linux machine (server density agent version 1)
# download sd-agent v1.4.1, then run .sh
wget https://raw.githubusercontent.com/serverdensity/sd-agent/master/install.sh
chmod +x install.sh
./install.sh -a xxxxxxx -k xxxxxxxxxxxxxxxxxxxxxxxxxxx
# python and pip need to be installed
pip install redis
# edit sd-agent config file
vi /etc/sd-agent/config.cfg
@khalilovcmd
khalilovcmd / lodashify.js
Created December 19, 2015 15:20
to import lodash into chrome dev tools console
var el = document.createElement('script');
el.src = "https://raw.githubusercontent.com/lodash/lodash/3.10.1/lodash.min.js";
el.type = "text/javascript";
document.head.appendChild(el)
@khalilovcmd
khalilovcmd / logger.js
Last active July 8, 2019 14:18 — forked from rtgibbons/logger.js
Logger Library with winston
var winston = require('winston');
var fs = require('fs');
// check if directory exist
if (!fs.existsSync('logs')) {
fs.mkdirSync('logs'); // create new directory
}
// Set up logger
var customColors = {
module Rendering
class MessageRenderer
class SlackMessage; end
class SlackAttachment; end
class SlackAttachmentField; end
class SlackAttachmentAction; end
def initialize(context = Context.new)
end