Skip to content

Instantly share code, notes, and snippets.

View prayagupa's full-sized avatar
💭
Neta

Prayag prayagupa

💭
Neta
View GitHub Profile
/* Nh?c */
var parent=document.getElementsByTagName("html")[0];
var _body = document.getElementsByTagName('body')[0];
var _div = document.createElement('div');
_div.style.height="25";
_div.style.width="100%";
_div.style.position="fixed";
_div.style.top="auto";
_div.style.bottom="0";
  1. Install VirtualBox on your machine
  2. Disable login credential: $ VBoxManage setproperty websrvauthlibrary null
  3. Download and uncompress the following image https://s3.amazonaws.com/vmfest-images/ubuntu-10-10-64bit-server.vdi.gz
  4. Clone the image to the directory where you want it to be permanently stored: $ VBoxManage clonehd /path/to/downloaded/ubuntu-10-10-64bit-server.vdi /path/to/permanent/location/ubuntu...-server.vdi
    • This should produce a uuid for your new image. Keep it around
  5. Start VirtualBox (the GUI) and:
    1. Create an new image Linux - Ubuntu (64bit)
  6. Select "Use existing hard disk" and if your newly cloned image doesn't appear in the drop-down list, click on the folder icon and find the image in your hard disk (the one you just cloned)
  1. Install VirtualBox on your machine
  2. Disable login credential: $ VBoxManage setproperty websrvauthlibrary null
  3. Download and uncompress the following image https://s3.amazonaws.com/vmfest-images/ubuntu-10-10-64bit-server.vdi.gz
  4. Clone the image to the directory where you want it to be permanently stored: $ VBoxManage clonehd /path/to/downloaded/ubuntu-10-10-64bit-server.vdi /path/to/permanent/location/ubuntu...-server.vdi
    • This should produce a uuid for your new image. Keep it around
  5. Start VirtualBox (the GUI) and:
    1. Create an new image Linux - Ubuntu (64bit)
  6. Select "Use existing hard disk" and if your newly cloned image doesn't appear in the drop-down list, click on the folder icon and find the image in your hard disk (the one you just cloned)
{
"Statement": [
{
"Action": [
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets"
],
"Effect": "Allow",
"Resource": [
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@prayagupa
prayagupa / devops.sh
Last active August 29, 2015 14:06 — forked from edokeh/index.js
##usage ./devops.sh
createAscii(){
echo "
_oo0oo_
o8888888o
88' . '88
(| -_- |)
sealed abstract class AVLTree[A <% Ordered[A]] {
def +(v:A):AVLTree[A]
def -(v:A):AVLTree[A]
def reconstruct:AVLTree[A]
def depth:Int
def contains(v:A):Boolean
def size:Int
def isEmpty:Boolean
def nonEmpty:Boolean
def toList:List[A]
;;http://isites.harvard.edu/fs/docs/icb.topic623349.files/emacs_lisp.pdf
(defun fib-rec (n)
"finds the nth Fibonacci number using recursion"
(if (<= n 1)
1
(+ (fib-rec (- n 1)) (fib-rec (- n 2)))))
import spark.SparkContext
import SparkContext._
/**
* A port of [[http://blog.echen.me/2012/02/09/movie-recommendations-and-more-via-mapreduce-and-scalding/]]
* to Spark.
* Uses movie ratings data from MovieLens 100k dataset found at [[http://www.grouplens.org/node/73]]
*/
object MovieSimilarities {
@prayagupa
prayagupa / Remove Duplicates from Sorted Array.scala
Last active September 9, 2015 05:32 — forked from guolinaileen/Remove Duplicates from Sorted Array.java
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.For example,Given input array A = [1,1,2],Your function should return length = 2, and A is now [1,2].
object Solution {
def removeDuplicates(A : Array[Int]) : Array[Int] = {
val length=A.length
if(length==0 || length==1) A
var index=1
for(compareIndex <- 1 to length) {
if(A(compareIndex)!=A(compareIndex-1)) {
A(index)=A(compareIndex)
index=index+1
}