Skip to content

Instantly share code, notes, and snippets.

View allen-munsch's full-sized avatar
⁉️

James allen-munsch

⁉️
View GitHub Profile
@Bouke
Bouke / gist:10454272
Last active September 22, 2023 17:23
Install FreeTDS, unixODBC and pyodbc on OS X

First, install the following libraries:

$ brew install unixodbc
$ brew install freetds --with-unixodbc

FreeTDS should already work now, without configuration:

$ tsql -S [IP or hostname] -U [username] -P [password]
locale is "en_US.UTF-8"

locale charset is "UTF-8"

@smoser
smoser / cloud-to-lxd
Last active January 10, 2019 16:07
lxc tools. Random tools around lxc.
#!/bin/bash
VERBOSITY=0
TEMP_D=""
UC_PREP="/usr/share/lxc/hooks/ubuntu-cloud-prep"
error() { echo "$@" 1>&2; }
fail() { [ $# -eq 0 ] || error "$@"; exit 1; }
Usage() {
@StuartGordonReid
StuartGordonReid / RiskAdjustedReturnMetrics.py
Last active June 9, 2024 23:00
Measured of Risk-adjusted Return
import math
import numpy
import numpy.random as nrand
"""
Note - for some of the metrics the absolute value is returns. This is because if the risk (loss) is higher we want to
discount the expected excess return from the portfolio by a higher amount. Therefore risk should be positive.
"""
@TySkby
TySkby / timeout.py
Last active June 5, 2024 17:06
Timeout decorator/context manager using signals (for Python 3)
#!/usr/bin/env python3
"""Easily put time restrictions on things
Note: Requires Python 3.x
Usage as a context manager:
```
with timeout(10):
something_that_should_not_exceed_ten_seconds()
```
@joergsteinkamp
joergsteinkamp / Grass-GIS.ipynb
Last active December 14, 2021 07:40
Simple Opensource GIS examples with Grass and R
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joergsteinkamp
joergsteinkamp / PythonGIS_Intro.ipynb
Created September 7, 2017 06:45
Python GIS example by Christian Werner
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MitchRatquest
MitchRatquest / scroll.py
Last active December 22, 2017 21:21
string scrolling in python with curses
#!/usr/bin/python
import curses
from time import sleep
curses.initscr()
string = "this is a really fun scrolling string "
def scroll(stdscr):
try:
curses.curs_set(0)
@MitchRatquest
MitchRatquest / organelle-clone-july5.ino
Created July 6, 2018 00:43
organelle clone controller stm32 blue pill
#include <OSCBundle.h>
#include <SLIPEncodedSerial.h>
#include <OSCMessage.h>
SLIPEncodedSerial SLIPSerial(Serial);
// encoder stuff below vvvvv
#define MAXENCODERS 1
volatile uint32_t encstate[MAXENCODERS];
volatile uint32_t encflag[MAXENCODERS];
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active June 17, 2024 23:44
set -e, -u, -o, -x pipefail explanation
@kenmori
kenmori / error Your lockfile.md
Last active May 20, 2024 09:20
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`

error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.

if you update your package.json only. and then run yarn install --frozen-lockfile

The above error show you on console.

it's say that you need to run just yarn install.