Skip to content

Instantly share code, notes, and snippets.

View mndrake's full-sized avatar
🏠
Working from home

David Carlson mndrake

🏠
Working from home
View GitHub Profile
@mndrake
mndrake / DeedleFormatter.fsx
Created April 23, 2014 17:03
Deedle Series and IFrame formatter for IFSharp
#I "../lib"
#r "FSharp.Markdown.dll"
#r "FSharp.Literate.dll"
#r "Deedle.dll"
open System.IO
open Deedle
open Deedle.Internal
open FSharp.Literate
open FSharp.Markdown
@mndrake
mndrake / Resizer.cs
Last active June 30, 2018 11:23
Modified version of the Excel-DNA Resize UDF that also accepts a range name argument that will be used to label the resized array. Original version : http://exceldna.codeplex.com/SourceControl/latest#Distribution/Samples/ArrayResizer.dna
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
namespace Utility
{
using System;
@mndrake
mndrake / .vimrc
Last active June 18, 2018 02:42
python 2.7 vim config
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let g:vim_bootstrap_langs = "html, javascript,python,scala"
let g:vim_bootstrap_editor = "vim"
@mndrake
mndrake / init.vim
Last active June 17, 2018 19:39
neovim init.vim
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
let g:vim_bootstrap_langs = "html,javascript,python,scala"
@mndrake
mndrake / start.sh
Last active June 17, 2018 15:22
domino start script for jupyterlab
#!/bin/bash
set -o nounset -o errexit -o pipefail
IP_ADDR=$(/sbin/ifconfig eth0 | grep "inet addr" | cut -d ":" -f2 | cut -d " " -f1)
CONF_DIR="$HOME/.ipython/profile_default"
CONF_FILE="${CONF_DIR}/ipython_notebook_config.py"
mkdir -p "${CONF_DIR}"
cat <<EOF >>"${CONF_FILE}"
library(shiny)
shinyServer(function(input, output, session) {
# Return the components of the URL in a string:
output$urlText <- renderText({
paste(sep = "",
"protocol: ", session$clientData$url_protocol, "\n",
"hostname: ", session$clientData$url_hostname, "\n",
"pathname: ", session$clientData$url_pathname, "\n",
@mndrake
mndrake / dplyr_sql_extension.R
Last active August 24, 2016 00:26
extension methods for dplyr remote tables
library(dplyr)
library(nycflights13)
conn <- nycflights13_sqlite()
flights_sql <- tbl(conn, 'flights')
weather_sql <- tbl(conn, 'weather')
`[.tbl_sql` <- function(x, condition) {
x %>% select_(condition)
}
namespace Utility
{
using System;
using System.Collections.Generic;
// based on:
//http://stackoverflow.com/questions/2852161/c-sharp-memoization-of-functions-with-arbitrary-number-of-arguments
public static class Memoizer
{
@mndrake
mndrake / Utopia.fsx
Created January 15, 2014 17:45
Agent based calculation engine
open System
open System.Collections.Generic
open System.Collections.ObjectModel
open System.ComponentModel
open System.Threading
open Microsoft.FSharp.Control
open Microsoft.FSharp.Reflection
type Value =
| Dirty
@mndrake
mndrake / Excel4.cs
Last active December 21, 2015 23:19
A C# wrapper class for the Excel4/Excel12 methods contained in Excel-DNA to mimic basic methods of the COM object model
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
namespace Excel4
{