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
# Turn a source into an infaillible source by adding blank when the source is | |
# not available. | |
# @param s the source to turn infaillible | |
# @category Source / Track Processing | |
def mksafe(~id="mksafe",s) | |
fallback(id=id,track_sensitive=false,[s,blank(id="safe_blank")]) | |
end | |
# Alias for the <code>l[k]</code> notation. | |
# @category List |
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
# dump all databases once every 24 hours | |
45 4 * * * root nice -n 19 su - postgres -c "pg_dumpall --clean" | gzip -9 > /var/local/backup/postgres/postgres_all.sql.gz | |
# vacuum all databases every night (full vacuum on Sunday night, lazy vacuum every other night) | |
45 3 * * 0 root nice -n 19 su - postgres -c "vacuumdb --all --full --analyze" | |
45 3 * * 1-6 root nice -n 19 su - postgres -c "vacuumdb --all --analyze --quiet" | |
# re-index all databases once a week | |
0 3 * * 0 root nice -n 19 su - postgres -c 'psql -t -c "select datname from pg_database order by datname;" | xargs -n 1 -I"{}" -- psql -U postgres {} -c "reindex database {};"' |
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
{ | |
"states": [ | |
{ | |
"abbr": "AC", | |
"name": "Acre", | |
"capital": "Rio Branco", | |
"cities": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", |
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 { | |
index index.php; | |
set $basepath "/var/www"; | |
set $domain $host; | |
# check one name domain for simple application | |
if ($domain ~ "^(.[^.]*)\.dev$") { | |
set $domain $1; | |
set $rootpath "${domain}"; |
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
jQuery.fn.vectorMap('addMap', 'brazil', {"width":"1000","height":"921","paths":{"BRA1294":{"name":"Goiás","path":"M621.30 406.90l0.30 0.50 0.30 0.40 2.70 1.90 0.40 0.40 0.10 0.20 0.10 0.20 -0.10 0.20 0.00 0.10 -0.20 0.20 -0.20 0.20 -0.20 0.10 -1.30 0.90 -0.20 0.20 -0.10 0.30 -0.40 2.50 0.00 0.80 0.00 0.40 0.10 0.10 0.50 0.30 1.60 0.60 0.10 0.10 0.10 0.30 0.00 0.60 -0.10 0.30 -0.10 0.40 0.00 0.20 -0.10 0.10 -0.20 0.20 -0.70 0.60 -0.50 0.30 -0.80 0.40 -0.30 0.30 -0.30 1.10 -0.50 1.70 -0.40 1.20 -0.30 1.00 -0.10 0.30 0.00 0.20 -0.10 2.10 0.30 2.70 0.90 3.00 1.00 1.50 0.10 0.20 1.00 2.60 0.00 0.10 0.20 0.20 1.20 0.60 0.10 0.20 0.50 0.50 0.60 1.10 0.10 0.10 1.00 0.50 0.60 0.20 0.20 0.20 0.10 0.10 0.00 0.20 0.00 0.30 -0.30 1.10 -0.60 1.10 -0.10 0.20 0.00 0.30 0.00 0.60 0.00 0.50 0.20 0.50 0.00 0.10 0.30 0.40 0.40 0.90 0.10 0.60 0.10 0.40 0.10 0.70 -0.10 0.40 -0.10 0.40 -0.10 0.20 -0.10 0.30 -0.50 0.50 -0.50 0.50 -1.10 1.80 -0.60 0.30 -0.20 0.30 -0.20 0.30 -0.20 0.30 -0.20 0.20 -0.20 0.10 -0.10 -0.10 -0.40 -0.10 -0. |
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 { | |
listen 80; | |
listen [::]:80; | |
server_name radio.example.com; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
location / { |
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 background noise profile from mp3 | |
/usr/bin/sox noise.mp3 -n noiseprof noise.prof | |
# Remove noise from mp3 using profile | |
/usr/bin/sox input.mp3 output.mp3 noisered noise.prof 0.21 | |
# Remove silence from mp3 | |
/usr/bin/sox input.mp3 output.mp3 silence -l 1 0.3 5% -1 2.0 5% | |
# Remove noise and silence in a single command |
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
set("log.file.path", "/tmp/test.log") | |
set("server.socket.path","/tmp/<script>.sock") | |
set("server.socket",true) | |
# Simple check function to match any "Finished with ...." line in the logs | |
def checker(n) | |
# get info from upcoming request | |
m = request.metadata(n) | |
# command to find if the file was played according to the log | |
command = 'grep -F' |
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
import * as mongoose from 'mongoose'; | |
export let Schema = mongoose.Schema; | |
export let ObjectId = mongoose.Schema.Types.ObjectId; | |
export let Mixed = mongoose.Schema.Types.Mixed; | |
export interface IHeroModel extends mongoose.Document { | |
name: string; | |
power: string; |
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
KEYMAPOPTS="us us" | |
HOSTNAMEOPTS="-n alpine" | |
INTERFACESOPTS="auto lo | |
iface lo inet loopback | |
auto eth0 | |
iface eth0 inet dhcp | |
hostname alpine | |
" | |
TIMEZONEOPTS="-z UTC" |
OlderNewer