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
#include <cstdio> | |
#include <iostream> | |
#include <cstring> | |
#include <time.h> | |
#include <stdio.h> | |
#define FILE_HEADER_SIZE 14 | |
#define INFO_HEADER_SIZE 40 | |
#define NOTE_PAD_WIDTH 315; |
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
defmodule Progress do | |
def start_link name do | |
{:ok, file} = File.open name, [:write] | |
spawn_link(fn -> loop(file, 0, 0) end) | |
end | |
def loop file, size, total do | |
receive do | |
%HTTPoison.AsyncChunk{chunk: chunk} -> | |
IO.inspect {size, total} |
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
player -ao null input.mp4 -vo jpeg:outdier=out -ss 00:00:00 -fps 20 | |
convert -resize 50% out/*.jpg %03d.jpg | |
# OptimizeFrame, OptimizeTransparency | |
convert -delay 5 -layers Optimize -fuzz 10% *.jpg output.gif |
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 | |
data Exp = Var String | |
| And Exp Exp | |
| Or Exp Exp | |
| Imp Exp Exp | |
| Not Exp | |
deriving Eq | |
instance Show Exp where |
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 RSpecHelper | |
def leads | |
if block_given? | |
subject | |
expect(yield) | |
else | |
expect { subject } | |
end | |
end | |
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
names = Dir.entries("source") - [".", ".."] | |
names.each do |name| | |
base = File.basename(name, ".*") | |
p `ffmpeg -i "source/#{name}" -strict -2 -movflags +faststart "output/#{base}.mp4"` | |
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
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6 | |
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1 |
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
require 'fileutils' | |
def blobs(path) | |
Dir.glob(path) | |
end | |
def files(files) | |
files.select {|f| File.file?(f) } | |
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
PRE_IFS=$IFS | |
IFS=$'\n' | |
path=$1 | |
directories=$(find "$path" -maxdepth 1 -mindepth 1 -type d) | |
files=$(find "$path" -maxdepth 1 -mindepth 1 -type f) | |
for f in $files; do | |
fn=$(basename "$f") | |
for d in $directories; 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
{-# START_FILE package.yaml #-} | |
name: {{name}} | |
version: 0.1.0.0 | |
#synopsis: | |
#description: | |
homepage: https://github.com/{{github-username}}{{^github-username}}githubuser{{/github-username}}/{{name}}#readme | |
license: BSD3 | |
author: {{author-name}}{{^author-name}}Author name here{{/author-name}} | |
maintainer: {{author-email}}{{^author-email}}[email protected]{{/author-email}} | |
copyright: {{year}}{{^year}}2017{{/year}} {{author-name}}{{^author-name}}Author name here{{/author-name}} |