This file contains hidden or 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 python | |
import os | |
import subprocess | |
import time | |
import imaplib | |
import praw | |
import json | |
try: | |
from minecraft_query import MinecraftQuery |
This file contains hidden or 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 | |
# Deletes all branches except for the ones you want to keep | |
# Git-Bash doesn't have /dev/null, so I can't suppress the IF output | |
echo -n "Don't delete these: " | |
read protect | |
echo "VERIFY" | |
for branch in $(git branch | cut -c 3-) | |
do |
This file contains hidden or 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 | |
# Applies last commit to a branch to the current branch | |
branch=$1 | |
hash=$(git log $branch | head -1 | awk '{ print $2 }') | |
message=$(git log $branch | head -5 | tail -1) | |
if [ "$branch" == "" ] | |
then | |
echo "Forgot your branch, stupid." |
This file contains hidden or 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
clear; sleep 0.5 | |
echo "WELCOME to RSSFeeder" | |
echo " "; sleep 0.2; | |
echo "by Monte Cristo" | |
echo " "; echo " "; | |
sleep 0.3; echo "Type a number to select an option." | |
sleep 0.2 | |
echo "1: Setup an RSSFeeder loop." | |
echo "2: About RSSFeeder." | |
echo "3: Exit RSSFeeder." |
This file contains hidden or 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 | |
# feature-diff | |
# Constructs a summary of all outstanding work in feature branches | |
# Paths | |
REPO=/your/repo | |
OUTPUT=/path/to/output/textfile.txt | |
DEVELOP=upstream/develop | |
MASTER=upstream/master |
This file contains hidden or 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
import os | |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
SECRET_KEY = 'lol-so-secret' | |
DEBUG = True | |
ALLOWED_HOSTS = [] | |
INSTALLED_APPS = ( | |
'django.contrib.admin', | |
'django.contrib.auth', |
This file contains hidden or 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
qualifying = self.filter(...) | |
return {1: lambda: qualifying[0]}.get(len(qualifying), lambda: None)() |
This file contains hidden or 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
from uuid import uuid4 | |
from django.db import models | |
from django.core.validators import MinValueValidator | |
class Rate(models.Model): | |
id = models.UUIDField(primary_key=True, | |
editable=False, | |
default=uuid4, | |
unique=True) |
This file contains hidden or 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
from decimal import Decimal | |
class Rate(models.Model): | |
'''...rest of model...''' | |
def save(self, *args, **kwargs): | |
self.amount_per_day = self.amount / Decimal(self.days) | |
return super(Rate, self).save(*args, **kwargs) |
OlderNewer