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 simple_salesforce import Salesforce, SalesforceMalformedRequest | |
from argparse import ArgumentParser | |
from csv import DictWriter | |
from datetime import date | |
from pathlib import Path | |
production_instance = 'yourinstance.salesforce.com' | |
parser = ArgumentParser(description="Backs up all Salesforce objects to csv files") | |
parser.add_argument("username", help="User to authenticate as. Should be part of an 'integration_user' profile or some profile with no ip range restriction") |
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/sh | |
# | |
# This hook prevents you from committing any file containing "debugger". | |
# | |
# To enable this hook, rename this file to ".git/hooks/pre-commit". | |
DIFF_FILES=`git diff-index HEAD --cached --name-only` | |
if [ $? -ne 0 ] | |
then |
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
# created by doing vim surgery on | |
# https://github.com/pygments/pygments/blob/master/pygments/lexers/_mapping.py | |
ext_map = {'.htaccess': ['apacheconf', 'aconf', 'apache'], | |
'BAS': ['qbasic', 'basic'], | |
'Dockerfile': ['docker', 'dockerfile'], | |
'G': ['antlr-as', 'antlr-actionscript','antlr-csharp', 'antlr-c#','antlr-cpp','antlr-java','antlr-objc','antlr-perl','antlr-python','antlr-ruby', 'antlr-rb'], | |
'Kconfig*': ['kconfig', 'menuconfig', 'linux-config', 'kernel-config'], | |
'PRG': ['foxpro', 'vfp', 'clipper', 'xbase'], | |
'Rd': ['rd',], | |
'Rout': ['rconsole', 'rout'], |
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
import sys | |
from suds import client | |
from suds.wsse import Security, UsernameToken | |
from suds.sax.text import Raw | |
from suds.sudsobject import asdict | |
from suds import WebFault | |
''' | |
Given a Workday Employee_ID, returns the last name of that employee. |
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 functools import wraps | |
# sometimes you need to do a bunch of tracing and it is easier to just see docstrings flow by rather than write print statements. | |
def logdoc(func): | |
'''Wraps a function and logs the docstring of that function whenever it is called | |
Just decorate the function: | |
@logdoc | |
def foo(bar): | |
"""prints the bar and returns twice the bar""" | |
print(bar) |
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
""" | |
Lays down the law for your phone, telling it what to do and when | |
Inspired by docblades' silent_night.py | |
""" | |
import android, string, time, math, datetime | |
from datetime import time, datetime, timedelta | |
from time import sleep | |
from threading import Timer | |
droid = android.Android() | |
interval_secs = 480 |
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 pathlib import WindowsPath | |
import petl as etl | |
class DataMasseuse: | |
data_files = WindowsPath("s:\files\QTRLY"); | |
new_data_files = WindowsPath("s:\files\QTRLY\cleaned") | |
final_file = new_data_files / "final_file.csv" | |
def main(self): | |
#let's start fresh. Delete the previous result |
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
/* | |
url is http://localhost/~matt/wp/wp-admin/admin.php?page=wordprss.php#/feed/2 | |
*/ | |
function FeedListCtrl($scope, $http, $routeParams,$location,$log){ | |
$log.log('in feedscontrol'); | |
$log.log('location is '+ $location.path()); | |
$log.log($routeParams); | |
} |
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
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Faceur</title> | |
<meta name="description" content=""> |
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 | |
// Set the headers so the file downloads | |
header('Content-type: application/xml+opml'); | |
header('Content-Disposition: attachment; filename="Wordprss-OPML-Export.xml"'); | |
//oh PHP. Why you gotta be so difficult about escaping things? | |
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?".">"; | |
?> | |
<opml version="1.0" > | |
<head> |
NewerOlder