Skip to content

Instantly share code, notes, and snippets.

set -e
# Source: https://askubuntu.com/a/1188143/1622689
sudo apt-get install build-essential linux-headers-`uname -r`
sudo apt-get install autoconf automake bc bison build-essential flex gcc g++ make python -y
sudo apt-get purge virtualbox -y
sudo sh -c 'echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -c | cut -f2) non-free contrib" >> /etc/apt/sources.list.d/virtualbox.org.list'
/*
* Filename:
* Logger.ts
* Author:
* Pramod Kotipalli (p13i@stanford.edu)
* Description:
* A custom logging service for react-native/expo apps
* that provides more verbose options, including printing
* the device's name/brand to the console, useful when
* debugging multiple devices from the same console output.
// Version 1: tracking if the operations succeed and nesting if-else statements
bool LinkedList_Add(LinkedList_t *List, Data_t Data)
{
bool Success = true;
if (NULL == List)
{
Success = false;
}
@p13i
p13i / index.html
Last active December 3, 2020 03:10 — forked from johannesMatevosyan/index.html
Creating RTCPeerConnection
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Creating RTCPeerConnection</title>
<style>
body {
background-color: #3D6DF2;
margin-top: 15px;
}
  • One side effect of using GitHub Gists as a data store is the ability to track how documents change over time, in addition to their current contents. It's really fun to see how documents change over time!

  • The automatic saving feature to a cloud service is incredibly reassuring for me.

Next features

  • A menu status bar at all times at the top of the screen showing the current time, updated every second, and status of the app

  • Ability to modify certain settings like the API oAuth keys and preferred update duration online, perhaps by using a QR code read by Glass populated online that conveys JSON information

  • achieved for the time-being: using uncommitted Preferences.java file that the developer will have to fill out

@p13i
p13i / LevenshteinStringSimilarityIndex.java
Created August 13, 2019 21:25
Produces a 0.0 to 1.0 index of the similarity between two strings using the Levenshtein edit distance function
package io.p13i.ra.similarity;
import io.p13i.ra.utils.Assert;
import io.p13i.ra.cache.ICache;
import io.p13i.ra.cache.LimitedCapacityCache;
import io.p13i.ra.utils.Tuple;
import java.util.Objects;
import java.io.Closeable;
import java.io.Flushable;
import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.Queue;
import java.util.logging.Logger;
/**
* Writes log files to a after a specified number of items are writen to the buffer
@p13i
p13i / JSON.swift
Created February 15, 2018 22:02
Simple JSON wrapper for Foundation's JSONEncoder and JSONDecoder
//
// JSON.swift
//
// Created by Pramod Kotipalli on 11/1/17.
// Copyright © 2017 Pramod Kotipalli. All rights reserved.
//
import Foundation
public class JSON {
@p13i
p13i / frameworks.txt
Created September 6, 2016 23:13
Common CSS frameworks
(In order of complexity)
Skeleton CSS (http://getskeleton.com/)
Foundation (http://foundation.zurb.com/)
Bootstrap (http://getbootstrap.com/)
Materialize CSS (http://materializecss.com/)
Angular Material (https://material.angularjs.org/latest/)
import math
def findDayOfWeek(month, day, year):
monthCode = getMonthCode(month, year)
yearCode = getYearCode(year)
dayOfWeekNumber = day + monthCode + yearCode
daysOfWeek = dict({