Skip to content

Instantly share code, notes, and snippets.

View emilyhorsman's full-sized avatar

Emily Horsman emilyhorsman

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
/* global window */
import React, { Component } from 'react'
import { getDisplayName } from '~/utils'
/**
* Uses requestAnimationFrame to provide the running time of the component.
*/
function withAnimationTime(WrappedComponent) {
if (qs('oauth_token') && qs('oauth_verifier')) {
var url = '/auth/callback/twitter?' + window.location.search.substring(1);
fetch(url, { credentials: 'same-origin' })
.then(function(res) {
return res.json();
})
.then(function(json) {
console.log(json);
if (json['status'] === 'success') {
{
"data": [
{
"type": "timer",
"attributes": {
"countdown_from": 60
}
},
{
"type": "timer",
---
- hosts: hypervisor
handlers:
- name: reload firewall
shell: 'firewall-cmd --reload'
changed_when: false
tasks:
- name: ensure fastestmirror is enabled
lineinfile: dest=/etc/dnf/dnf.conf regexp=^fastestmirror line=fastestmirror=True
- name: install vim
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' formats "%F{175}%b%f (%s) "
git_object_count() {
git count-objects -v | cut -d: -f 2 | paste -sd+ - | bc
}
count_matches() {
echo $1 | grep $2 | wc -l | sed -e 's/^[ \t]*//'
var path = require('path');
var http = require('http');
var fs = require('fs');
var spawn = require('child_process').spawn;
function safe_path(request_url) {
var cwd = path.resolve(path.dirname());
var target = path.resolve(request_url.slice(1));
if (target.indexOf(cwd) !== 0)
return;
<script id="a">
(function() {
var c = document.createElement("link");
c.rel = "stylesheet";
c.href = "/css/async.css";
c.media = "only x";
var b = document.getElementById("a");
b.parentNode.insertBefore(c, b);
function k() {
# Useful colour chart:
# https://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg
if [[ -s $HOME/antigen/antigen.zsh ]]
then
source $HOME/antigen/antigen.zsh
# This contains helpful things such as forward deletion.
antigen bundle robbyrussell/oh-my-zsh lib/key-bindings.zsh
antigen bundle robbyrussell/oh-my-zsh lib/history.zsh
@emilyhorsman
emilyhorsman / ffmpeg.bash
Last active September 16, 2015 22:52
foobar
$ ffmpeg -i video.mp4 -c:v libx264 -ss 00:00:00.000 -t 18 -r 15 -b:v 700K video2.mp4
$ ffmpeg -i video.mp4 -c:v libvpx -filter:v scale=720:-1 -ss 00:00:00.000 -t 18 -crf 10 -b:v 700K -c:a libvorbis video.webm