Skip to content

Instantly share code, notes, and snippets.

View grandadmiral-thrawn's full-sized avatar

Fox Peterson grandadmiral-thrawn

  • Hire me?
  • Vancouver, wa
View GitHub Profile
@quantumlicht
quantumlicht / containers_app.js
Created August 4, 2016 02:32
Redux React-Native App
import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import {
View
} from 'react-native'
import Svg,{
Circle,
Ellipse,
G,
@grandadmiral-thrawn
grandadmiral-thrawn / startnode.sh
Created August 31, 2015 04:43
Basic File Structure for Node Apps
#!/bin/sh
mkdir nodeapp
cd nodeapp
mkdir public
mkdir templates
cd public
mkdir css
mkdir images
mkdir js
cd js
@grandadmiral-thrawn
grandadmiral-thrawn / README.md
Created August 13, 2015 15:19
A quick script to convert Sherri's Hobo Logger Data to the accepted WaTeR.py format

convert sherri's data

In the first line of the file you will see a list called "myfiles". For the streams there are only 5 or 6 files, so instead of iterating over a big list its much easier to just put them in there.

Put your files in that list.

You can see down below that I have built a constructor based on the name coming in to extract the "E1" etc. from the name of the original file and pass it to the output file which is very picky about having the word reformatted in it. You might be good to keep the naming convention in the "my files" list if you are confused by the conversion.

@grandadmiral-thrawn
grandadmiral-thrawn / litedbbuild.py
Created November 23, 2014 17:14
simple csv to sql lite template
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Write a csv file to sql lite data base if it exists and if the file exists
For the first one, you will need to create the db, dropping a db of the same name
Furthermore, comment out those lines (see try section in write_csv_to_db), and
just use the insertion statement
"""
@tinybike
tinybike / mssql_to_csv.py
Last active October 22, 2023 18:12
simple mssql -> csv file example using pymssql
#!/usr/bin/env python
"""
simple mssql -> csv file example using pymssql
@author jack@tinybike.net
"""
import csv
import datetime
import pymssql
from decimal import Decimal
@mojaray2k
mojaray2k / jsbin.burut.html
Last active September 19, 2023 15:42
CSS only custom-styled select Todd Parker - Filament Group Inc. How this works: This styles a native select consistently cross-platform with only minimal CSS. The native select is then styled so it is essentially invisible (no appearance, border, bg) leaving only the select's text visible. There is a wrapper around the select that has the majori…
<html>
<head>
<title>Select styles with CSS only</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: #fff;
font-family: helvetica, sans-serif;
margin: 4% 10%
}
@mbostock
mbostock / .block
Last active December 17, 2023 21:17
Save SVG as PNG
license: gpl-3.0
@jonathan-taylor
jonathan-taylor / execute_and_save.py
Created June 8, 2012 08:09
A script to load an .ipynb file, execute all cells in order and output the resulting notebook. Depends on https://github.com/jonathan-taylor/nbconvert/tree/json2json
"""
simple example script for running notebooks and saving the resulting notebook.
Usage: `execute_and_save.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and the outputs are overwritten and
stored in new notebooks foo_executed.ipynb, etc.
"""
import os,sys,time