Skip to content

Instantly share code, notes, and snippets.

View kylesuss's full-sized avatar

Kyle Suss kylesuss

View GitHub Profile
@kylesuss
kylesuss / Send PunchClock Activity to HipChat.rb
Last active August 29, 2015 14:04
Simple steps to get Hipchat notifications up and running in 5 minutes. For use with the PunchClockServer from Panic: https://github.com/panicinc/PunchClockServer
# 1. Update the Gemfile
gem 'hipchat'
# 2. Retrieve dependencies via the command line
$ bundle install
# 3. Register a new API Auth Token of type Notification in the Group Admin, which only has access to send messages to rooms (requires admin access).
@kylesuss
kylesuss / S3 Public Bucket
Created June 13, 2014 20:27
S3 Public Bucket
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"AddPerm",
"Effect":"Allow",
"Principal": {
"AWS": "*"
},
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::example.com/*"
# Setup dir and repo
mkdir underscore-string
cd underscore-string
git init
# Make some files we'll need
touch README.md package.js smart.json
# Add the submodule and checkout the desired branch
git submodule add git://github.com/epeli/underscore.string.git lib/underscore.string
// Put this in a build.gradle file in the root
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.3+'
}
}
// List available SDK targets w/ IDs
android list targets
// Create a project
android create project --target <TARGET-ID> --name <YOURAPPNAME> --path <PATH-TO-WORKSPACE>/<YOURAPPNAME> --activity MainActivity --package com.example.YOURAPPNAME
// Build a project
gradle build
gradle assembleDebug
{
"Version": "2014-01-01",
"Statement": [{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": { "AWS": "*" },
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::BUCKET_NAME/*" ]
}]
}
<VirtualHost *:80>
ServerName myapp.example.com
RewriteEngine On
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName myapp.example.com
DocumentRoot /var/www/myapp/current/public
<Directory /var/www/myapp/current/public>
$(window).on('beforeunload', function() {
$(window).scrollTop(0);
});
var _ = {
now: Date.now || function() { return new Date().getTime(); },
throttle: function(func, wait, options) {
var context, args, result;
var timeout = null;
var previous = 0;
options || (options = {});
var later = function() {
# List active connections
sudo netstat -ntlp
# Find Node install path
whereis node