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
#http://www.engadget.com/2011/08/22/why-hibernate-or-safe-sleep-mode-is-no-longer-necessary-in-os/ | |
#https://www.idelta.info/archives/some-hidden-changes-in-os-x-el-capitan/ | |
# disable hibernation | |
sudo pmset hibernatemode 0 | |
# clear the image file | |
sudo rm -rf /var/vm/sleepimage | |
# inhibit file recreation |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Local HTML5 Video Player</title> | |
</head> | |
<body> | |
<style> | |
* { box-sizing: border-box; } |
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
WALLACE: Good evening from the Thomas and Mack Center at the University of Nevada, Las Vegas. I’m Chris Wallace of Fox News, and I welcome you to the third and final of the 2016 presidential debates between Secretary of State Hillary Clinton and Donald J. Trump. | |
WALLACE: This debate is sponsored by the Commission on Presidential Debates. The commission has designed the format: Six roughly 15-minute segments with two-minute answers to the first question, then open discussion for the rest of each segment. Both campaigns have agreed to those rules. | |
For the record, I decided the topics and the questions in each topic. None of those questions has been shared with the commission or the two candidates. The audience here in the hall has promised to remain silent. No cheers, boos, or other interruptions so we and you can focus on what the candidates have to say. | |
WALLACE: No noise, except right now, as we welcome the Democratic nominee for president, Secretary Clinton, and the Republican nominee for president, Mr. Trum |
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
<?php | |
#Thanks to the VoyantTools Twitter (@VoyantTools) for the original php script!) | |
$dirname = dirname(__FILE__); | |
$filename = "debate3.txt"; #assumes you have https://gist.github.com/paigecm/52ce175a98a3f0baa76dc0847c445b5e | |
$speaker = ""; $speeches = array(); | |
foreach(file("$dirname/$filename") as $line) { | |
$withoutname = preg_replace("/^(WALLACE|CLINTON|TRUMP):/","", $line); | |
if ($line!=$withoutname) { | |
$speaker = substr($line, 0, strpos($line, ":")); | |
} |
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
library(tidyverse) | |
library(stringr) | |
# read in the transcript | |
# I simply copied the text from the page at | |
# https://www.washingtonpost.com/news/the-fix/wp/2016/09/26/the-first-trump-clinton-presidential-debate-transcript-annotated/ | |
# and popped it into a txt file | |
xx <- scan("first_debate_2016.txt", "character") |
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 python | |
# encoding: utf-8 | |
import tweepy #https://github.com/tweepy/tweepy | |
import csv | |
#Twitter API credentials | |
consumer_key = "" | |
consumer_secret = "" | |
access_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 python | |
from nltk import Text | |
from nltk.corpus import PlaintextCorpusReader | |
CORPUS_ROOT = '/Users/benjamin/Development/corpora/gutenburg/' | |
if __name__ == "__main__": | |
reader = PlaintextCorpusReader(CORPUS_ROOT, '.*') |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Canvas Hexagonal Map</title> | |
<style type="text/css"> | |
canvas { | |
border:0; | |
display:block; | |
margin:0 auto; |
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
# R code for basic collocation statistics on a text corpus. | |
# Extracts LHS and RHS collocates of a word of interest | |
# over a user-defined span. Calculates frequency of | |
# collocates and mean distances. | |
examp1 <- "When discussing performance with colleagues, teaching, sending a bug report or | |
searching for guidance on mailing lists and here on SO, a reproducible example is often | |
asked and always helpful. What are your tips for creating an excellent example? How do | |
you paste data structures from r in a text format? What other information should you | |
include? Are there other tricks in addition to using dput(), dump() or structure()? |
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
<html> | |
<head> | |
<title>Flash Cards</title> | |
<link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'> | |
<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'> | |
<style type="text/css"> | |
html, body { | |
height: 100%; | |
margin: 0; |
NewerOlder