This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name cal_anchors | |
// @version 1 | |
// @grant none | |
// @include http://cal.huc.edu/* | |
// ==/UserScript== | |
const queryString = window.location.search; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.core.display import display, HTML | |
display(HTML("<style>.container { width:95% !important; }</style>")) | |
display(HTML("<style>.output_result { max-width:90% !important; }</style>")) | |
import numpy as np | |
np.set_printoptions(precision=3) | |
np.set_printoptions(linewidth=170) | |
np.set_printoptions(suppress=True) | |
np.random.seed(42) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nbformat | |
import functools | |
import sys | |
def get_key(obj, key): | |
if isinstance(obj, dict): | |
return obj.get(key, None) | |
elif isinstance(obj, (list, tuple)) and key < len(obj): | |
return obj[key] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
-- stack --resolver lts-12.0 script | |
import Network.HTTP.Simple (parseRequest, httpLbs, getResponseBody) | |
import qualified Data.ByteString.Lazy as BL (writeFile) | |
import System.Environment (getArgs) | |
import Data.Foldable (for_, traverse_) | |
import Control.Concurrent.Async | |
-- Get the following program working to download the 4 URLs and save | |
-- their contents in the given files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"dataset_reader": { | |
"type": "conll2003", | |
"tag_label": "ner", | |
"token_indexers": { | |
"tokens": { | |
"type": "single_id", | |
"lowercase_tokens": true | |
}, | |
"token_characters": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import spacy | |
def annotate(xml): | |
# xml matches the pattern above | |
if xml[1] == "/": | |
return xml[2:-1] + "-end" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# systemd unit file for CentOS 7, Ubuntu 15.04 | |
# | |
# Customize this file based on your bundler location, app directory, etc. | |
# Put this in /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu). | |
# Run: | |
# - systemctl enable sidekiq | |
# - systemctl {start,stop,restart} sidekiq | |
# | |
# This file corresponds to a single Sidekiq process. Add multiple copies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "bundler/setup" | |
require "shoryuken/cli" | |
environment_path = File.expand_path("config/environment.rb") | |
require environment_path if File.exist?(environment_path) | |
Rails.application.eager_load! if defined?(Rails) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: http://blog.ivanilves.com/2016/rails-dump-fixtures-from-db/ | |
# Usage: | |
# * rake db:fixtures:dump to dump all models. | |
# * rake db:fixtures:dump MODELS="user billing_account" to dump only User and BillingAccount models. | |
# | |
namespace :db do | |
namespace :fixtures do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Syntax | |
import Parser | |
import Eval | |
import Pretty | |
import Counter | |
import Control.Monad | |
import Control.Monad.Trans |
NewerOlder