Skip to content

Instantly share code, notes, and snippets.

View minshallj's full-sized avatar

Jacob Minshall minshallj

  • Endpoint Corp
  • San Diego
View GitHub Profile
@minshallj
minshallj / stupid.sh
Last active August 29, 2015 14:18
just a little something stupid
n=$1
[ "$n" == "" ] && n=100
echo "#include <stdio.h>"
echo "int main() {"
echo " int i;"
echo -n " for (i = 0; i < $n; i++) printf(\"%d\\n\", i==0?"
for i in $(seq 1 $n); do
printf "$n:i==$i?"
let n=$n-1
@minshallj
minshallj / foo.js
Last active March 13, 2023 18:28
roslibjs example
//* The Ros object, wrapping a web socket connection to rosbridge.
var ros = new ROSLIB.Ros({
url: 'ws://localhost:9090' // url to your rosbridge server
});
//* A topic for messaging.
var exampleTopic = new ROSLIB.Topic({
ros: ros,
name: '/com/endpoint/example', // use a sensible namespace
messageType: 'std_msgs/String'
default: all
CFLAGS += -I/home/jacob/dev/libgit2/include
LDFLAGS += -L/home/jacob/dev/libgit2/build
LIBRARIES += -lgit2
OBJECTS = sample.o
all: $(OBJECTS)
gcc $(CFLAGS) $(LDFLAGS) -o out.out $(OBJECTS) $(LIBRARIES)
@minshallj
minshallj / fun.c
Created January 10, 2015 07:09
What will this gist return? Maybe (most likely) you need to assume certain architectures, so let's just say x86
struct stuff {
int arr[4];
int i;
};
int main() {
struct stuff s;
for (s.i = 0; s.i <= 4; s.i++)
s.arr[s.i] = 0;
@minshallj
minshallj / guess.c
Last active October 13, 2015 20:08
guess what the return statement is
int main() {
int i;
int arr[4];
for (i = 0; i <= 4; i++)
arr[i] = 0;
return i;
}
@minshallj
minshallj / second_gist.py
Last active October 12, 2015 18:38
to pi and not so much beyond
#python program
class guy:
def __init__(self, param):
self.name = param
print("My name is", self.name)
def my_guy_func(self, the_range):
total = 0
count = 1