Skip to content

Instantly share code, notes, and snippets.

View caspar's full-sized avatar
🌴

Caspar Lant caspar

🌴
View GitHub Profile
@caspar
caspar / vpn
Last active November 13, 2023 17:57
Cisco Anyconnect VPN CLI Script (for NYU/other networks)
#!/bin/bash
# FILEPATH: /usr/local/bin/vpn
# This script is used to connect/disconnect to a VPN using the Cisco AnyConnect client over the command line.
# Usage:
# vpn (connect|disconnect)
# make file executable
chmod +x /usr/local/bin/vpn
//************************************************************
// this is a simple example that uses the easyMesh library
//
// 1. blinks led once for every node on the mesh
// 2. blink cycle repeats every BLINK_PERIOD
// 3. sends a silly message to every node on the mesh at a random time betweew 1 and 5 seconds
// 4. prints anything it recieves to Serial.print
//
//
//************************************************************
@caspar
caspar / BlogTemplate.html
Created December 29, 2014 05:23
Blog Template
<!DOCTYPE html>
<!--
Theme: THE THEME v0.2
Design: Themes that you like - Premium
Autor: Lutz Preuss 2014
Version: 0.2 - 10.03.2014
-->
<html>
<head>
<title>{Title}</title>

Keybase proof

I hereby claim:

  • I am caspar on github.
  • I am caspar (https://keybase.io/caspar) on keybase.
  • I have a public key whose fingerprint is D429 CB20 D2E1 5F40 96B1 0AF1 1138 FC9C 36CC B67F

To claim this, I am signing this object:

import java.io.*;
import java.util.*;
public class Sort{
public static void main(String[] args){
public void radixSort{
int
}
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@caspar
caspar / AddWord.java
Last active December 30, 2015 09:59
Adds a word to Wordsearch.java
public boolean AddWord (int r, int c, int dx, int dy, String word){
if (dx == 0 && dy == 0)
return false; //this would mean that the word was not sprouting in any direction. Only the first letter would render.
int i = 0;
//dx: "X-Direction" -- (-1) for Left, (1) for Right, (0) for neither;
//dy: "Y-Direction" -- ditto;
try{
@caspar
caspar / FillIn
Last active December 30, 2015 09:59
Fill in the blank spaces in Wordsearch.java with random letter (char-s).
import java.util.*;
Random R = new Random();
public void FillIn(){
for (int x = 0; x < columns; x++)
for (int y = 0; y < rows; y++)
if (board[x][y] == '-')
board[x][y] = (char)(R.nextInt(26 + 'a');
}
@caspar
caspar / Arrays3
Created November 9, 2013 22:00
Calculate the standard deviation of an array.
public class Arrays3{
public double mean(double[] array){
double sum = 0;
for (int i = 0; i < array.length; i ++){
sum = sum + array[i];
}
return sum;
}