Skip to content

Instantly share code, notes, and snippets.

// FOR THE PURPOSES of this code sample, some code essential
// for the functioning of this script was removed.
// Please view the "Finding PPTs" page source of
// http://pramodk.net/GT/MATH2803/PPTs/
// to see a functional example.
$("input[name='submit']").click(function () { // Upon clicking the submit button, run this function
// Get the input values
var maxS = $("input[name='s_bound']").val();
import math
def GCD(a , b):
if(b == 0):
return a
return GCD(b, a - math.floor(a/b)*b)
# Input values here and run
print(GCD(9876, 54321))
import math
def findDayOfWeek(month, day, year):
monthCode = getMonthCode(month, year)
yearCode = getYearCode(year)
dayOfWeekNumber = day + monthCode + yearCode
daysOfWeek = dict({
@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/)
@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 {
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 / 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;
  • 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 / 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;
}
// 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;
}