Skip to content

Instantly share code, notes, and snippets.

View Mindstormer619's full-sized avatar
💭
Vibing ❄️

Siddarth Iyer Mindstormer619

💭
Vibing ❄️
View GitHub Profile
@Mindstormer619
Mindstormer619 / wlog.sh
Created November 7, 2020 18:51
To be placed in bashrc
#!/bin/bash
### Add or edit worklog entry -- uses VSCode in PATH
### Usage: wlog [dateString]
function wlog {
local wlogFolder="/d/Workspace/Worklog"
if [ -z "$1" ]; then
local curdate=$(date +"%Y-%m-%d %a")
else
local curdate=$(date -d "$1" +"%Y-%m-%d %a")
@Mindstormer619
Mindstormer619 / EditDistance.java
Last active February 15, 2017 07:02
Java implementation of Levenshtein distance. Follows a lot of "clean code" principles I learnt from Robert C Martin's book Chapters 1-4.
import java.util.ArrayList;
import java.util.Scanner;
public class EditDistance {
private static final int INSERT_COST = 1;
private static final int DELETE_COST = 1;
private static final int SUBST_COST = 2;
private static int[][] distances;
private static String fromString;
@Mindstormer619
Mindstormer619 / dailyprog298e.py
Created January 17, 2017 18:02
r/dailyprogrammer Challenge #298 [Easy] Solution
exp = raw_input()
# assuming exp is balanced
stack = []
justClosed = False # did we just close a paren in the last operation
for ch in exp:
if ch != ')':
stack.append(ch)
public class MainActivity extends AppCompatActivity implements SensorEventListener {
Socket socket;
SensorManager sensorManager;
Sensor accelerometer;
TextView textView;
String ip_addr;
String y_value;
boolean isRunning=true;
@Override
protected void onCreate(Bundle savedInstanceState) {
@Mindstormer619
Mindstormer619 / 0_reuse_code.js
Created September 11, 2016 15:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Mindstormer619
Mindstormer619 / PRNG.ipynb
Created April 9, 2016 04:28
PRNGs - Implementation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
/*
Shameless port of a shameless port
@defunkt => @janl => @aq
See http://github.com/defunkt/mustache for more info.