This file contains 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
for f in `ls *.zip`; do unzip "$f" -d "${f%.zip}"; done |
This file contains 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
class Vocabulary | |
# @param [String] file_name Path to a word2vec vocabulary binary file | |
def initialize(file_name) | |
@file_name = file_name | |
@size = 0 | |
@vocabulary = {} | |
@word_count = 0 | |
read_file | |
end |
This file contains 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 pymongo | |
cl = pymongo.MongoClient() | |
db = cl.ner-dict | |
db = cl['ner-dict'] | |
c = db.dict | |
c.count | |
c.count() | |
qs = c.find() |
This file contains 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
#!/bin/zsh | |
# | |
# Highlight a given file and copy it as RTF. | |
# | |
# Simon Olofsson <simon@olofsson.de> | |
# | |
set -o errexit | |
set -o nounset |
This file contains 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 ActiveRecord | |
class SchemaDumper | |
def dump(stream) | |
header(stream) | |
extensions(stream) | |
enums(stream) | |
tables(stream) | |
trailer(stream) | |
stream | |
end |
This file contains 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 |
This file contains 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 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 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 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" |
OlderNewer