Skip to content

Instantly share code, notes, and snippets.

View jononon's full-sized avatar

Jonathan Damico jononon

View GitHub Profile
@jpearman
jpearman / flywheel_s.c
Last active February 4, 2018 09:06
Simplified version of flywheel control code that does not use a structure to hold all variables
#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, I2C_1, , sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Motor, port2, Motor_FW1, tmotorVex393HighSpeed_MC29, openLoop, encoderPort, I2C_1)
#pragma config(Motor, port3, Motor_FW2, tmotorVex393HighSpeed_MC29, openLoop, reversed)
#pragma config(Motor, port4, Motor_FW3, tmotorVex393HighSpeed_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/*-----------------------------------------------------------------------------*/
/* */
/* Copyright (c) James Pearman */
@joech4n
joech4n / boxcar-growl.py
Last active February 24, 2016 17:22
boxcar-growl.py - Send Boxcar Notification with CLI (Python)
#!/usr/bin/env python
# https://gist.github.com/joech4n/1b3d394ceb8b776f06d7
import os
import sys
import subprocess
import argparse
import ConfigParser
import shlex
@bennadel
bennadel / code-1.htm
Created March 25, 2014 01:06
Ask Ben: Parsing CSV Strings With Javascript Exec() Regular Expression Command
<script type="text/javascript">
// This will parse a delimited string into an array of
// arrays. The default delimiter is the comma, but this
// can be overriden in the second argument.
function CSVToArray( strData, strDelimiter ){
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = (strDelimiter || ",");
@pongstr
pongstr / README.md
Last active February 21, 2020 22:07
Display Google Docs Spreadsheet as JSON.

Google Docs Spreadsheet as JSON

This code is taken from DJ's Weblog, thanks a lot for this!

How to use:

  1. You'll need the key of your spreadsheet, the url format should be like this: https://docs.google.com/spreadsheet/ccc?key=**YOUR-KEY-HERE**=drive_web#gid=0 and also the sheet number (i.e., Sheet 1).
  2. In your document file menu, you'll find File Menu > Tools > Script Editor (you will be redirected to Google's script editor.
  3. Create a new Script file, and paste the content of the SheetAsJSON.js to the editor stage, and save it.
@fwiffo
fwiffo / pologlotquine.c
Created March 24, 2013 14:51
A polyglot quine. Will compile, run and print its source code as C, C++, Python (2.x or 3.x) or Perl.
#include <stdio.h>
#define q(a,...) a
#define substr q
#define eval(a) main(){char c[]=a,n=10;c[419]=0;printf(c+4,n,n,n,n,34,34,n,34,39,c+4,39,34,n);}/* Copyright (C) Thomas Schumm <[email protected]>
exec("from sys import*;substr=q=lambda y:exit(stdout.write(y[4:-46]%((10,)*4+(34,34,10,34,39,y[4:-46],39,34,10))))",None);#*/
eval(substr(q("$p='#include <stdio.h>%c#define q(a,...) a%c#define substr q%c#define eval(a) main(){char c[]=a,n=10;c[419]=0;printf(c+4,n,n,n,n,34,34,n,34,39,c+4,39,34,n);}/* Copyright (C) Thomas Schumm <[email protected]>%cexec(%cfrom sys import*;substr=q=lambda y:exit(stdout.write(y[4:-46]%%((10,)*4+(34,34,10,34,39,y[4:-46],39,34,10))))%c,None);#*/%ceval(substr(q(%c$p=%c%s%c;printf($p,(10)x4,34,34,10,34,39,$p,39,34,10)%c),1,-1))%c';printf($p,(10)x4,34,34,10,34,39,$p,39,34,10)"),1,-1))