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-ecs' | |
class EcsTenantAudit | |
attr_reader :region, :cluster | |
def initialize(region: "us-east-1", cluster: "ecs-q") | |
@region = region | |
@cluster = cluster |
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
### Keybase proof | |
I hereby claim: | |
* I am pygeek on github. | |
* I am pygeek (https://keybase.io/pygeek) on keybase. | |
* I have a public key ASB4UGOl9pBofVKU7Or0-DNCGC9-nqGlbwBgO6mXILT4ngo | |
To claim this, I am signing this object: |
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 | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
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
# This is an example of how to properly structure your tests when handle nested conditions. | |
# When our test structure represents the code structure, it enables us to better understand the code and more easily identify gaps in our testing coverage. | |
# Take an elseif condition for example | |
if x | |
put x | |
elsif y | |
put y | |
else | |
put z |
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
$(function(){ | |
var uniform_el_height = { | |
'parent_el' : '.row#management-services_row-6451 .container', //common immediate parent of elements to make uniform height | |
'el' : '> .block', //element to make uniform height | |
'resize_els' : function(initial_offset){ | |
var $max_height = 0; | |
var self = this; | |
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
for local_field in self._meta.local_fields: | |
if isinstance(local_field, models.fields.files.FileField): | |
file_attr = getattr(prev_version, local_field.attname) | |
if file_attr: | |
file_ = File(file_attr) | |
setattr(self, local_field.attname, file_) | |
self.save() |
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
if settings.DEBUG: | |
urlpatterns += patterns('', | |
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', { | |
'document_root': settings.STATIC_ROOT, | |
}), | |
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', { | |
'document_root': settings.MEDIA_ROOT, | |
}), | |
) |
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
#credits - http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs | |
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative | |
lg2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit | |
lg = !"git lg1" |
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
rom django import template | |
from django.conf import settings | |
register = template.Library() | |
# Usage: | |
# Define GOOGLE_ANALYTICS_CODE in your settings. | |
# In your base template put: {% google_analytics %} | |
@register.simple_tag | |
def google_analytics(): |
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
$(function(){ | |
var $footer_position = function(){ | |
if($(document).height() <= $(window).height()){ | |
$('footer').css({'position' : 'absolute', | |
'bottom' : '0px' | |
}) | |
}else{ | |
$('footer').css({'position' : 'static'}) | |
} | |
}; |
NewerOlder