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
<!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> |
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
/* global window */ | |
import React, { Component } from 'react' | |
import { getDisplayName } from '~/utils' | |
/** | |
* Uses requestAnimationFrame to provide the running time of the component. | |
*/ | |
function withAnimationTime(WrappedComponent) { |
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
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') { |
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
{ | |
"data": [ | |
{ | |
"type": "timer", | |
"attributes": { | |
"countdown_from": 60 | |
} | |
}, | |
{ | |
"type": "timer", |
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
--- | |
- 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 |
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
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]*//' |
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
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; |
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
<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() { |
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
# 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 |
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
$ 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 |