Skip to content

Instantly share code, notes, and snippets.

View willbarrett's full-sized avatar
💭
🚀

Will Barrett willbarrett

💭
🚀
View GitHub Profile
@willbarrett
willbarrett / nginx
Last active August 29, 2015 13:56
Provisioning Script for Starter School
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@willbarrett
willbarrett / gist:9307877
Last active August 29, 2015 13:56
Instructions for Capistrano Deploy

First, ensure you are in the jeffs-store directory.

To set up the environment for this deployment example, run these commands:

vagrant box add capistrano https://dl.dropboxusercontent.com/u/1863351/StarterSchoolFeb2014/capistrano.box
git checkout capistrano
git pull origin capistrano
bundle update
vagrant halt

vagrant up capistrano

@willbarrett
willbarrett / gist:f9bb1394a3a7af9a7a35
Last active August 29, 2015 14:01
Dart meetup notes

What is Dart?

Dart is a language and SDK created by Google for writing cross-browser maintainable JavaScript. It is also a working spec of the W3C - they're going to standardize it as a 2nd language that should be implemented by the browser. As a heavily smalltalk-inspired language with classical inheritance, it is much easier to write than today's JavaScript. It has test tools, type checking, and all the other niceties of a real programming language that wasn't designed in 10 days.

Why do I care?

Because it compiles to JavaScript, and thus can be used today to write front-end applications. Angular has Dart support, though most other MVC front-end libraries do not as of now.

Should we use it at Sqwiggle?

Not right now. We've already solved most of the problems it fixes.

What good came of Will going to this meetup?

ActiveRecord::RecordInvalid: Validation failed: Name cannot be a number
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/validations.rb:56:in `save!'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/transactions.rb:264:in `block in save!'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.15/lib/active_record/transactions.rb:208:in `transaction'
/app/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.8.0.218/lib/new_relic/agent/method_tracer.rb:549:in `block in transaction_with_trace_ActiveRecord_self_name_transaction'
/app/vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.8.0.2
May 31 16:56:36 production-web app/web.1: NoMethodError (undefined method `update_subscription' for nil:NilClass):
May 31 16:56:36 production-web app/web.1: app/models/organization.rb:117:in `update_user_count'
May 31 16:56:36 production-web app/web.1: app/models/invite.rb:39:in `accept!'
May 31 16:56:36 production-web app/web.1: app/models/signup.rb:70:in `persist_with_invite!'
May 31 16:56:36 production-web app/web.1: app/models/signup.rb:48:in `persist!'
May 31 16:56:36 production-web app/web.1: app/models/signup.rb:42:in `save!'
May 31 16:56:36 production-web app/web.1: app/controllers/registrations_controller.rb:36:in `create'
May 31 16:56:36 production-web app/web.1: lib/platformify.rb:12:in `call'
@willbarrett
willbarrett / gist:40ecda4af714d9a65c38
Created July 2, 2014 15:53
Sample STP from Janus
"v=0\r\no=- 7052933919468865461 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS HAp5tz34SpsUmg8YKJQ2j7X2BhroAA7DiAhE\r\nm=audio 1 RTP/SAVPF 111 103 104 0 8 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:IlXRDrISPbIX7NIY\r\na=ice-pwd:R93GsYxSsrh9E3QFwoAl9yFa\r\na=ice-options:google-ice\r\na=fingerprint:sha-256 FC:38:40:3D:C2:DC:CF:59:73:89:AF:10:53:95:C2:2B:FA:3B:C7:D3:06:F6:DD:30:CC:DB:94:D6:50:EF:9C:81\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\na=ssrc:1457780410 cname:OmS37p2tGAt0xy0X\r\na=ssrc:1457780410 msid:HAp5tz34SpsUmg8YKJQ2j7X2BhroAA7DiAhE 23e7f4e9-3d99-4658-96ec-3d453bc2c4bf\r\na=ssrc
@willbarrett
willbarrett / gist:44dea0951f5e67251a4b
Created July 15, 2014 14:21
Debug output from Janus
Got a HTTP POST request on /janus/1/77213617...
... parsing request...
Session: 1
Handle: 77213617
Processing POST data (application/json)...
-- Uploaded data (153 bytes)
-- Data we have now (153 bytes)
Got a HTTP POST request on /janus/1/77213617...
... parsing request...
Session: 1
{
"action": "Joined",
"payload": {
"handle_id": 2570490266,
"id": 494,
"janus_room_id": 2895897935,
"session_id": 1,
"session_port": 8089,
"users": [
{
@willbarrett
willbarrett / gist:30ee2c0d83f7e1037d26
Created November 19, 2014 18:21
Track all intervals
window.originalSetInterval = window.setInterval;
window.activeIntervals = 0;
window.activeIntervalList = {};
window.setInterval = function(func, delay, identifier) {
var interval = window.originalSetInterval(func, delay);
window.activeIntervalList[interval] = {ident: identifier, func: func, delay: delay};
return interval;
};
window.originalClearInterval = window.clearInterval;
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `--config /opt/janus/etc/janus/janus.cfg --configs-folder=/opt/janus/etc/janus -'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f087820bd28 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
(gdb) bt
#0 0x00007f087820bd28 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1 0x00007f0862764349 in janus_audiobridge_hangup_media (handle=handle@entry=0x1cdedd0)
at plugins/janus_audiobridge.c:1499
#2 0x00007f0862764b45 in janus_audiobridge_destroy_session (handle=0x1cdedd0,