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
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. |
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 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' |
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
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) |
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
$start-color:#2B73A2; | |
$number: 12; | |
@for $i from 1 through $number { | |
.label-#{$i} { | |
color:adjust_hue($start-color, ($i - 1) * (360 / $number)); | |
} | |
} |
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
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 |
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
@mixin prop-query($min-size, $property, $value){ | |
@media screen and (min-width: $min-size){ | |
#{$property}: $value; | |
} | |
} |
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
#!/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//' |
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
<?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"; |
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
// ================================================== | |
// Gulp Variables | |
// ================================================== | |
var gulp = require('gulp'), | |
gutil = require('gulp-util'); | |
// Compass | |
var compass = require('gulp-compass'); |
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 | |
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| |
OlderNewer