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
require 'date' | |
SECONDS_PER_CHUNK = 300 | |
FILE_NAME = 'file.mp3' | |
seconds = %x(mp3info -p "%S\n" #{FILE_NAME}).to_i | |
today = Date.today | |
start_date = Time.new(today.year, today.month, today.day) | |
end_date = start_date + seconds |
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 bash | |
# script: watch | |
# author: Mike Smullin <mike@smullindesign.com> | |
# license: GPLv3 | |
# description: | |
# watches the given path for changes | |
# and executes a given command when changes occur | |
# usage: | |
# watch <path> <cmd...> | |
# |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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/bash | |
PROGNAME=${0##*/} | |
INPUT='' | |
QUIET='0' | |
NOSTATS='0' | |
max_input_size=0 | |
max_output_size=0 | |
usage() |
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
create extension postgres_fdw; | |
CREATE SERVER postgres_2 | |
FOREIGN DATA WRAPPER postgres_fdw | |
OPTIONS (dbname 'db_2', host '172.17.0.4', port '5432'); | |
CREATE USER MAPPING FOR CURRENT_USER | |
SERVER postgres_2 | |
OPTIONS (user 'usr', password 'pwd'); | |
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
//server code | |
const express = require('express') | |
const cors = require('cors') | |
const app = express() | |
const port = 3000 | |
//whitelist of custom headers | |
app.use(cors({origin: '*', exposedHeaders: 'X-LH-Auth,X-Powered-By' })) |
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
sudo firewall-cmd --add-port=8008-9000/tcp --permanent | |
sudo firewall-cmd --add-port=1900/udp --permanent | |
sudo firewall-cmd --add-port=5353/udp --permanent | |
sudo firewall-cmd --reload |