Skip to content

Instantly share code, notes, and snippets.

Mike Sarahan msarahan

Block or report user

Report or block msarahan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@msarahan
msarahan / qstem_notebook
Created Aug 21, 2013
QSTEM ipython notebook
View qstem_notebook
{
"metadata": {
"name": "QSTEM_simDemo"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Example</title>
<script type="text/javascript" src="vendor/jquery/1.7.1/jquery-1.7.1.min.js"></script>
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.min.js"></script>
View diff_no_whitespace.patch
diff --git a/jquery.facetview.js b/jquery.facetview.js
index 405caf7..4e063fd 100644
--- a/jquery.facetview.js
+++ b/jquery.facetview.js
@@ -589,7 +589,7 @@ search box - the end user will not know they are happening.
var filters = options.facets;
var thefilters = '';
for ( var idx = 0; idx < filters.length; idx++ ) {
- var _filterTmpl = '<table id="facetview_{{FILTER_NAME}}" class="facetview_filters table table-bordered table-condensed table-striped" style="display:none;"> \
+ var _filterTmpl = '<table id="facetview_{{FILTER_NAME}}" class="facetview_filters table table-bordered table-condensed table-striped"> \
View sentiment_time.py
def time_groups_to_plot_elements(slices, nbins=9):
"""Take the grouped time-sentiment relationships, and break it down into a single point/line for the plot"""
plot_data = {}
bins = np.linspace(-1.0, 1.0, nbins)
print bins
for k, v in slices.items():
binned_data = np.digitize(v["sentiment"], bins=bins) - 1
segments = np.zeros(nbins)
for bin_id in set(binned_data):
segments[bin_id] = v["sentiment"][binned_data==bin_id].count()
@msarahan
msarahan / AdminDeployment.xml
Created Apr 2, 2016
admin deployment for a C++ install of VS 2015 community from Chocolatey
View AdminDeployment.xml
<?xml version="1.0" encoding="utf-8"?>
<AdminDeploymentCustomizations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/wix/2011/AdminDeployment">
<BundleCustomizations TargetDir="C:\Program Files (x86)\Microsoft Visual Studio 14.0" NoCacheOnlyMode="default" NoWeb="default" NoRefresh="default" SuppressRefreshPrompt="default" Feed="default" />
<SelectableItemCustomizations>
<SelectableItemCustomization Id="TypeScriptV6" Selected="no" FriendlyName="TypeScript 1.7.6.0 for Visual Studio 2015 Update 1" />
<SelectableItemCustomization Id="VSUV1" Hidden="no" Selected="yes" FriendlyName="Visual Studio 2015 Update 1" />
<SelectableItemCustomization Id="VSUV1PreReqV1" Selected="yes" FriendlyName="Visual Studio 2015 Update 1 Prerequisite" />
<SelectableItemCustomization Id="MicroUpdateV1.2" Selected="yes" FriendlyName="Update for Microsoft Visual Studio 2015 (KB3110221)" />
<SelectableItemCustomization Id="WebToo
@msarahan
msarahan / install_miniconda.txt
Last active Apr 4, 2016
BoxStarter install for Miniconda
View install_miniconda.txt
$url = "https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe"
$output = "$PSScriptRoot\Miniconda3-latest-Windows-x86_64.exe"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $output)
#OR
(New-Object System.Net.WebClient).DownloadFile($url, $output)
$filepath = $PSScriptRoot\Miniconda3-latest-Windows-x86_64.exe
$args = "/S /D=C:\Miniconda3_x64"
View gist:8b8e06f1ef1a5823d09b4cefc7465412
In [8]: client=xmlrpclib.ServerProxy("https://pypi.io/pypi")
In [9]: client.package_releases('roundup')
---------------------------------------------------------------------------
Fault Traceback (most recent call last)
<ipython-input-9-9eae23c7d1d4> in <module>()
----> 1 client.package_releases('roundup')
/Users/msarahan/anaconda2/lib/python2.7/xmlrpclib.pyc in __call__(self, *args)
1238 return _Method(self.__send, "%s.%s" % (self.__name, name))
@msarahan
msarahan / conda_imports
Created Jun 22, 2016
imports on Windows, recorded with ```python -v -c "import conda"```
View conda_imports
C:\Users\builder>python -v -c "import conda"
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# C:\MC2x64\lib\site.pyc matches C:\MC2x64\lib\site.py
import site # precompiled from C:\MC2x64\lib\site.pyc
# C:\MC2x64\lib\os.pyc matches C:\MC2x64\lib\os.py
import os # precompiled from C:\MC2x64\lib\os.pyc
import errno # builtin
import nt # builtin
@msarahan
msarahan / AdminDeployment.xml
Created Aug 31, 2016
Install options for Visual CPP Build tools 2015
View AdminDeployment.xml
<?xml version="1.0" encoding="utf-8"?>
<AdminDeploymentCustomizations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/wix/2011/AdminDeployment">
<BundleCustomizations TargetDir="default" NoCacheOnlyMode="default" NoWeb="default" NoRefresh="default" SuppressRefreshPrompt="default" Feed="default" />
<SelectableItemCustomizations>
<SelectableItemCustomization Id="Win81SDK_CppBuildSKUV1" Hidden="no" Selected="yes" FriendlyName="Windows 8.1 SDK" />
<SelectableItemCustomization Id="GitForWindowsV1" Hidden="no" Selected="no" FriendlyName="Git for Windows" />
<SelectableItemCustomization Id="VSUV1PreReqV1" Selected="yes" FriendlyName="Visual Studio 2015 Update 1 Prerequisite" />
<SelectableItemCustomization Id="VSUV2RTMV2" Selected="yes" FriendlyName="Visual Studio 2015 Update 2" />
<SelectableItemCustomization Id="VSUV2PreReqV1" Selected="yes" FriendlyName="Visual Studio 2015 Update 2 Prerequisite" />
<
@msarahan
msarahan / utils_diff.diff
Last active Oct 3, 2016
Diff of changes in conda_build/utils.py from 1.21.14 to 2.0.2
View utils_diff.diff
diff --git a/conda_build/utils.py b/conda_build/utils.py
index c12fc44..a134205 100644
--- a/conda_build/utils.py
+++ b/conda_build/utils.py
@@ -1,70 +1,118 @@
from __future__ import absolute_import, division, print_function
+from collections import defaultdict
+import contextlib
+from difflib import get_close_matches
You can’t perform that action at this time.