Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mrsweaters on github.
  • I am me (https://keybase.io/me) on keybase.
  • I have a public key whose fingerprint is DA19 8E3F F34E C2BE A00B 1796 7096 4485 28A0 75BE

To claim this, I am signing this object:

@mrsweaters
mrsweaters / readonly.sql
Created January 26, 2016 19:34
Set MySQL to read-only
FLUSH TABLES WITH READ LOCK;
SET GLOBAL read_only = 1;
# and back to normal mode with:
SET GLOBAL read_only = 0;
UNLOCK TABLES;
@mrsweaters
mrsweaters / netstat.sh
Created December 3, 2015 21:33
check for network traffic
netstat -t -u -c
@mrsweaters
mrsweaters / robots.txt
Created November 30, 2015 23:51
robots.txt
User-agent: *
Disallow: /
@mrsweaters
mrsweaters / dashboard_controller.js
Created November 18, 2015 18:01
Intercom Angular.
dashboard.controller('DashboardController', ['$scope', '$state', '$rootScope', 'flash', '$location', 'Account', 'User', 'Test', 'Activity', 'Pusher', 'Alert', function($scope, $state, $rootScope, flash, $location, Account, User, Test, Activity, Pusher, Alert) {
$scope.setRootRecords = function () {
$rootScope.account = new Account(initialRecords.account);
$rootScope.currentUser = new User(initialRecords.currentUser);
$scope.activities = initialRecords.activities;
$scope.alerts = initialRecords.alerts;
$scope.projects = initialRecords.projects;
$rootScope.location = $location;
@mrsweaters
mrsweaters / README.md
Created October 25, 2015 17:13 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default and default-ssl to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@mrsweaters
mrsweaters / index.html
Last active October 19, 2015 15:53
Engineering 1
<html>
<body>
<% @warehouses.each do |warehouse| %>
<h2><%= warehouse %></h2>
<ul class="trucks">
<% warehouse.trucks.each do |truck| %>
<li>ID: <%= truck.id %><br>Miles: <%= truck.miles %></li>
<% end %>
<% end %>
@mrsweaters
mrsweaters / add.sql
Last active January 29, 2016 19:51
create and grant mysql permissions
mysql> CREATE USER '<user>'@'%' IDENTIFIED BY '<password>';
mysql> CREATE DATABASE <database_name>;
mysql> GRANT ALL PRIVILEGES on <database_name>.* To <user>@'%';
mysql> FLUSH PRIVILEGES;
+new Date()
1442443788513
"notableNote"+new Date()
"notableNoteWed Sep 16 2015 15:50:25 GMT-0700 (PDT)"
"notableNote"+(+new Date())
"notableNote1442443833329"
Node('div')
Uncaught TypeError: Illegal constructor(…)
var div = document.createElement("div");
undefined
@mrsweaters
mrsweaters / timedout.md
Created August 26, 2015 17:54
EC2 Operation Timed Oout

[EC2-VPC] Check the route table for the subnet. You need a route that sends all traffic destined outside the VPC (0.0.0.0/0) to the Internet gateway for the VPC.

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

In the Description tab, write down the values of VPC ID and Subnet ID.

Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

In the navigation pane, click Internet Gateways. Verify that there is an Internet gateway attached to your VPC. Otherwise, click Create Internet Gateway and follow the directions to create an Internet gateway, select the Internet gateway, and then click Attach to VPC and follow the directions to attach it to your VPC.