Skip to content

Instantly share code, notes, and snippets.

View shklqm's full-sized avatar

Shkelqim Memolla shklqm

View GitHub Profile
import moment from "moment-timezone";
export const mapObjectsToArray = (objects) => {
let index = -1, result = Array(objects.size);
Object.keys(objects).forEach((objectId)=>{
result[++index] = [objects[objectId]["createdAt"], objects[objectId]];
});
return result;
@shklqm
shklqm / commands
Last active January 31, 2017 08:37
screen -- share terminal screen
rsync remote@path local@host -- copy files
scp [-r] remote@path local@host -- copy files/dirs
nslookup www.somesite.com -- get ip
uptime -- get amount of up running time
xclip -- Reads from standard in, or from one or more files
nohup command_name [>filename] [2>&1] & -- run a command immune to hangups, with output to a non-tty
xmllint --format filename [>outfile] -- format a given xml file
start-all.sh
stop-all.sh
jps
mkdir intersect_classes
sudo javac -classpath /usr/local/hadoop/share/hadoop/common/hadoop-common-2.6.0.jar:/usr/local/hadoop/share/hadoop/common/lib/hadoop-annotations-2.6.0.jar:/usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.6.0.jar -d intersect_classes WordCount.java
jar -cvf intersect.jar -C intersect_classes/ .
@shklqm
shklqm / topics
Last active April 16, 2016 14:03
overview of FRP
introduction to GPU
Surfaces & multiresolution modelling
tay-tracing method & acceleration structures
radiosity method
#!/bin/python
def rem(keyToBeSearched, tree):
# print "calling"
for key,val in tree.items():
if key == keyToBeSearched:
# print "found", keyToBeSearched
tree.pop(key, None)
global branch
@shklqm
shklqm / tree
Last active March 2, 2016 19:28
#!/bin/python
from random import shuffle
def insert(n1,n2,tree):
if n2 in tree:
print "inserted1 with key", n2
d1 = {n1:{}}
tree[n2] = dict(tree[n2].items() + d1.items())
# print "returning...1"
@shklqm
shklqm / increasing-subsequence.cpp
Last active August 29, 2015 14:06
Find the length of the longest increasing subsequence in a given sequence.
#include <iostream>
using namespace std;
/*
Find the length of the longest increasing subsequence in a given sequence.
A simple array is taken as an example.
Time complexity is linear, O(n)
*/
int main()