Skip to content

Instantly share code, notes, and snippets.

View jeffbyrnes's full-sized avatar

Jeff Byrnes jeffbyrnes

View GitHub Profile
KV_KEY = 'forecast-alert-datapoint'
module.exports = (robot) ->
postWeatherAlert = (json, callback) ->
postMessage = callback
now = new Date()
# This function posts an alert about the current forecast data always. It
# doesn't determine if the alert should be posted.
#!/usr/bin/env sh
#configurables
DBINSTANCE="yourdbinstanceID"
ENDPOINT="XXXXXXXXXXXX.us-east-1.rds.amazonaws.com"
USER='yourUser'
PASSWD='yourPassword'
DB1="yourDatabase1 yourDatabase2"
BUCKET='s3://your-bucket'
BACKUP_HOME='/mnt/backups'
@adarowski
adarowski / gist:1229764
Created September 20, 2011 17:45
box_gradient
Write this mixin once:
@mixin box_gradient($start, $end)
background-color: $start
background-image: -webkit-gradient(linear, left top, left bottom, from($start), to($end))
background-image: -webkit-linear-gradient(top, $start, $end)
background-image: -moz-linear-gradient(top, $start, $end)
background-image: -ms-linear-gradient(top, $start, $end)
background-image: -o-linear-gradient(top, $start, $end)
background-image: linear-gradient(top, $start, $end)
@orderedlist
orderedlist / labels.scss
Created July 9, 2012 18:42
Simple Label Colors with SCSS
$start-color:#2B73A2;
$number: 12;
@for $i from 1 through $number {
.label-#{$i} {
color:adjust_hue($start-color, ($i - 1) * (360 / $number));
}
}
@rafi
rafi / post-receive
Created March 25, 2010 19:34
Deploying with Git
mkdir ~/git/website.git && ~/git/cd website.git
git init --bare
mkdir ~/webapps/website
git config core.bare false
git config core.worktree /home/rafi/webapps/website ; NO TRAILING SLASH!!! Will screw up things real bad.
git config receive.denycurrentbranch ignore
; create a hook
cat > hooks/post-receive
#!/bin/sh
@mixin prop-query($min-size, $property, $value){
@media screen and (min-width: $min-size){
#{$property}: $value;
}
}
@scoates
scoates / twitter_user_to_image
Last active December 19, 2015 09:49
Get a twitter profile image from a username. We route around bad APIs. Twitter wears the scumbag hat, these days.
#!/bin/bash
# Usage: $0 username
# e.g.:
# $ ./twitter_user_to_image coates
# https://si0.twimg.com/profile_images/1597362183/me.jpg
curl -sL http://twitter.com/$1 | grep profile_images | head -n1 | perl -p -e's/.*?http/http/;s/".*//;s/_bigger//'
@notasausage
notasausage / get_twitter_avatar.php
Last active December 20, 2015 10:30 — forked from banksy89/gist:3334259
Return the profile image (avatar) of a Twitter user using their RSS feed (no API call necessary).
<?php
function getTwitterAvatar( $username, $size = "normal" ) {
// mini = 24px, normal = 48px, bigger = 73px
$sizes = array( "mini", "normal", "bigger" );
// Check for size, default to normal
if( in_array( $size, $sizes ) ) {
$variant = $size;
} else {
$variant = "normal";
@dperrera
dperrera / gulpfile.js
Last active January 3, 2016 22:19
My gulpfile.js
// ==================================================
// Gulp Variables
// ==================================================
var gulp = require('gulp'),
gutil = require('gulp-util');
// Compass
var compass = require('gulp-compass');
@bmhatfield
bmhatfield / ec2-security-group-rules
Created March 9, 2016 04:15
Output a human-readable & colorized view of your EC2 security group rules
#!/usr/bin/env ruby
require 'aws-sdk'
require 'colorize'
ec2 = Aws::EC2::Resource.new
ec2.security_groups.sort_by{|s| s.group_name }.each do |sg|
puts sg.group_name.underline unless sg.ip_permissions.empty?
sg.ip_permissions.each do |perm|