Skip to content

Instantly share code, notes, and snippets.

@eayoungs
eayoungs / i3 Config
Last active August 29, 2015 14:11
Config file for i3 tiling window manager - Forked from Scott Garman
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@eayoungs
eayoungs / internal_loads.py
Created December 23, 2014 03:07
This is a script written with eppy (but not yet integrated into the project) to change the value of internal loads and convert from IP to SI units
# Copyright (c) 2014 Eric Youngson
# This file is part of eppy.
# Eppy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Eppy is distributed in the hope that it will be useful,
@eayoungs
eayoungs / base.html
Last active August 29, 2015 14:15 — forked from wraithan/base.html
<!doctype html>
<html>
<head>
<title>{{page_name}}</title>
</head>
<body>
<h1>{{page_name}}</h1>
{% block content %}
{% endblock content %}
</body>
@eayoungs
eayoungs / ZoneHVAC:UnitVentilator.sublime-snippet
Last active August 29, 2015 14:15
Sublime Text Snippets for EnergyPlus Zone HVAC Template Objects
<snippet>
<content><![CDATA[
!!-- This snippet is based on the object located in Example File: UnitVent5Zone.idf --
!
!!Schedule:Compact,
!! UnitVentAvailability, !- Name
!! Any Number, !- Schedule Type Limits Name
!! Through: 12/31, !- Field 1
!! For: AllDays, !- Field 2
@eayoungs
eayoungs / pollutantmean.r
Created February 16, 2015 04:52
R Data Frame
pollutantmean <- function(directory, pollutant, id = 1:332) {
## 'directory' is a character vector of length 1 indicating
## the location of the CSV files
dir_vect <- as.character(directory)
polltnt_vect <- as.character(pollutant)
valid_files <- list.files(path = dir_vect, pattern = "\\.csv$")
if(length(valid_files) > 0) {
@eayoungs
eayoungs / readhtm.py
Last active August 29, 2015 14:21
Eppy readhtml script
from eppy import modeleditor
from eppy.modeleditor import IDF
from eppy import readhtml
import pandas as pd
import matplotlib
import numpy as np
import pprint
import glob, os
try:
@eayoungs
eayoungs / from_defchararray.py
Created June 30, 2015 01:45
numpy multiply function
def multiply(a, i):
"""
Return (a * i), that is string multiple concatenation,
element-wise.
Values in `i` of less than 0 are treated as 0 (which yields an
empty string).
Parameters
----------
@eayoungs
eayoungs / from_multiarraymodule.c
Created June 30, 2015 01:47
C function used by numpy multiply function
static PyObject *
_vec_string(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
{
PyArrayObject* char_array = NULL;
PyArray_Descr *type = NULL;
PyObject* method_name;
PyObject* args_seq = NULL;
PyObject* method = NULL;
PyObject* result = NULL;
@eayoungs
eayoungs / test_tilt.py
Last active August 29, 2015 14:24
eppy_failed_test
import numpy as np
from math import acos as arccos
from math import sqrt as sqrt
from tinynumpy import array as array
from pytest_helpers import almostequal
import math
def angle2vecs(vec1,vec2):
# vector a * vector b = |a|*|b|* cos(angle between vector a and vector b)
dot = np.dot(vec1,vec2)
@eayoungs
eayoungs / ipython_notebook_in_git.md
Created November 25, 2015 23:32 — forked from pbugnion/ ipython_notebook_in_git.md
Keeping IPython notebooks under Git version control

This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.

To use the script, follow the instructions given in the script's docstring.

For further details, read this blogpost.

The procedure outlined here is inspired by this answer on Stack Overflow.