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
word_list = [] | |
with open ('word_list.txt', 'r') as words: | |
for word in words: | |
word_list.append(word.strip()) | |
def contains(subword, word): | |
res = [] | |
for s in subword: |
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
sudo apt-get update | |
sudo apt-get install -y libssl1.0.0 openssl | |
# Confirm Build Date is at least Aril 7th 2014 | |
openssl version -a | |
# Restart all services listed by this command: | |
sudo lsof -n | grep ssl | grep DEL |
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
""" | |
Requirements: | |
AWS Account | |
Valid Access key and secret | |
A valid bucket setup | |
""" | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
import sys |
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
# -*- coding: utf-8 -*- | |
import urllib | |
import xlrd | |
class ExchangeRates(): | |
""" | |
Class to fetch exchange rate information from the Central Bank of Ireland | |
Example: | |
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
dicts_with_values = [{"value": 30}, {"value": 20}, {"value": 1}] | |
""" Horrible! """ | |
result = reduce(lambda x, y: x + y, [i["value"] for i in dicts_with_values]) | |
""" Nice, Pythonic """ | |
result = sum([i["value"] for i in dicts_with_values]) |
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
Sub Splitter() | |
Dim Mask As String | |
Dim Letters As Long | |
Dim Counter As Long | |
Dim DocName As String | |
Dim oDoc As Document | |
Dim oNewDoc As Document | |
Set oDoc = ActiveDocument | |
oDoc.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
function thousdansSeparater(nStr) { | |
nStr += ''; | |
x = nStr.split('.'); | |
x1 = x[0]; | |
x2 = x.length > 1 ? '.' + x[1] : ''; | |
var rgx = /(\d+)(\d{3})/; | |
while (rgx.test(x1)) { | |
x1 = x1.replace(rgx, '$1' + ',' + '$2'); | |
} |
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 | |
# Description: For each directory in ~/Development, descend into it, pull the latest from git and come back out of it. | |
find ~/Development/. -type d -print0 -maxdepth 1 | while IFS= read -r -d '' dir | |
do | |
cd $dir | |
git pull | |
cd ../ | |
done |
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
from git import Repo | |
from git import InvalidGitRepositoryError | |
import sys | |
import os | |
import getopt | |
settings = { | |
'repos_path': '/path/to/your/git/repos', | |
'cmd_options': 'b:r:', | |
'this_file_name': 'the_name_of_this_script.py' |
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 python | |
import os | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') | |
CHECKS = [ |
OlderNewer