try {
$attempts = 0;
retry:
throw new Exception('Oops!');
} catch (Exception $e) {
if ($attempts < 4) {
$attempts++;
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> | |
<meta charset='utf-8'> | |
<head> | |
<title>Cubism + Websockets</title> | |
<script language='javascript' src='d3.min.js'></script> | |
<script language='javascript' src='cubism.v1.js'></script> | |
<script language='javascript'> | |
/* I can never seem to remember: | |
Array.push() appends to the end, and returns the new length |
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
$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib" | |
require 'axlsx' | |
require 'date' | |
p = Axlsx::Package.new | |
wb = p.workbook | |
wb.styles do |style| | |
# Date/Time Styles | |
# |
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
1. Open "my.ini" in "C:\xampp\mysql\bin\" directory. | |
2. Edit the following lines. | |
# Add the following code before [client]. | |
default-character-set=utf8 | |
# Add the following code before [mysqld]. | |
character-set-server=utf8 | |
skip-character-set-client-handshake |
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
# Written by Aaron Cohen -- 1/14/2013 | |
# Brought to you by BitTorrent, Inc. | |
# "We're not just two guys in a basement in Sweden." TM | |
# | |
# This work is licensed under a Creative Commons Attribution 3.0 Unported License. | |
# See: http://creativecommons.org/licenses/by/3.0/ | |
import sys | |
import re | |
import socket |
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
DELIMITER $$ | |
-- | |
-- Functions | |
-- | |
CREATE FUNCTION `transliterate_func`(original VARCHAR(512)) RETURNS varchar(512) CHARSET utf8 | |
BEGIN | |
DECLARE translit VARCHAR(512) DEFAULT ''; | |
DECLARE len INT(3) DEFAULT 0; | |
DECLARE pos INT(3) DEFAULT 1; |
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/python | |
''' | |
Script to monitor live streams and send an Amazon SNS if the stream is down (and possibly take restorative action) | |
Future: | |
Black detect: ffmpeg -i out.mp4 -vf blackdetect -f null - | |
Note the following doesn't seem to fully work without looking at the debug logs | |
On live ffmpeg -y -i rtmp://cp30129.live.edgefcs.net/live/videoops-videoops@50541 -vf blackdetect -t 10 -loglevel debug -f null - | |
''' |
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 ruby -w -s | |
# -*- coding: utf-8 -*- | |
require 'axlsx' | |
## Some documentation ## | |
### Axlsx Gem ### | |
# Axlsx Docs: http://rubydoc.info/gems/axlsx/frames | |
# Axlsx::DataValidation: http://rubydoc.info/gems/axlsx/Axlsx/DataValidation |
OlderNewer