Skip to content

Instantly share code, notes, and snippets.

Jason Mobarak silverjam

Block or report user

Report or block silverjam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@silverjam
silverjam / cli.dhall
Created Sep 20, 2019
Generating lots of YAML with Dhall (recursive incoation translation)
View cli.dhall
let Argument : Type =
List
{ mapKey : Text
, mapValue :
{ help : Text
, index : Integer
, required : Bool
, takes_value : Bool
, value_name : Text
}
@silverjam
silverjam / socat.bash
Last active Apr 12, 2019
socat experiments
View socat.bash
# Create input FIFO
rm -f /tmp/input.fifo
mkfifo /tmp/input.fifo
# Bind to FD in the shell to keep the FIFO alive
exec 10<>/tmp/input.fifo
# Create output FIFO
rm -f /tmp/output.fifo
mkfifo /tmp/output.fifo
# Bind to FD in the shell to keep the FIFO alive
View 01_dist_to_ntrip_caster.py
# Usage: python dist_to_ntrip_caster.py
#
# Get list of NTRIP caster streams:
# > curl https://cddis-caster.gsfc.nasa.gov/ -o caster_reg.txt
#
# Find streams that support GPS + base station messages:
# > grep 1004.*100[56] caster_reg.txt >creg_gps.txt
#
# Find streams that support GLO + base station messages:
# > grep 100[56].*1012 caster_reg.txt >creg_glo.txt
View loadlibrary.ps1
Add-Type -TypeDefinition @"
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.ComponentModel;
public static class Kernel32c
{
[DllImport("kernel32", SetLastError=true, CharSet = CharSet.Ansi)]
@silverjam
silverjam / intents.json
Created Aug 10, 2016
Alexa Lambda Arduino
View intents.json
{
"intents": [
{
"intent": "YourDino"
},
{
"intent": "HasTeradactyl"
}
]
}
View keybase.md

Keybase proof

I hereby claim:

  • I am silverjam on github.
  • I am silverjam (https://keybase.io/silverjam) on keybase.
  • I have a public key whose fingerprint is 419A 9B7C 828C 5976 E6E5 8479 5D43 186D E68D C7DD

To claim this, I am signing this object:

View pathsearch.c
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#define COUNTOF(arr) (sizeof(arr) / sizeof(arr[0]))
char* pathsearch(const char* program)
@silverjam
silverjam / AddHeaderNumbers.js
Last active Sep 28, 2016
Google apps script to add header numbers to a document
View AddHeaderNumbers.js
var state = {
headerLevel1: 0,
headerLevel2: 0,
headerLevel3: 0,
}
var private = {
getSectionNumber: function (paragraph)
{
if ( paragraph.getHeading() == DocumentApp.ParagraphHeading.HEADING1 )
View HasUniqueChars.java
import java.util.*;
public class HasUniqueChars
{
public static boolean hasUniqueChars(String toTest)
{
char charArray[] = toTest.toCharArray();
Arrays.sort(charArray);
for (int x = 1; x < charArray.length; x++)
@silverjam
silverjam / MaxNodesInLevel.java
Created Feb 9, 2013
Given a binary tree return the level with maximum number of nodes.
View MaxNodesInLevel.java
import java.util.*;
import java.lang.*;
class Main
{
public static void countLevels(Integer tree[], int index, int levels[], int level)
{
if ( index >= tree.length )
return;
You can’t perform that action at this time.