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
<?php | |
DEFINE("DB_HOST","localhost"); | |
DEFINE("DB_USER","ricky"); | |
DEFINE("DB_PASS","is_a_douche"); | |
DEFINE("DB_NAME","rekt"); | |
?> |
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
<html> | |
<body> | |
<form action="page.php"> | |
<table> | |
<tr> | |
<td><input type="text" name="name"></td> | |
</tr> | |
<tr> | |
<td><input type="text" name="email"></td> | |
</tr> |
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
/* KP: Read in querystring values and perform filtering */ | |
var path = window.location.href; | |
$scope.searchTerms = path.indexOf('?') > 0 ? path.split('?')[1].split('&') : []; | |
if ($scope.searchTerms.length > 0) { | |
for (i = 0; i < $scope.searchTerms.length; i++) { | |
var searchTerm = $scope.searchTerms[i].split('='); | |
var name = searchTerm[0]; | |
var value = searchTerm[1]; | |
} |
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
function updateJson(endpointUri,payload, success, error) | |
{ | |
$.ajax({ | |
url: endpointUri, | |
type: "POST", | |
data: JSON.stringify(payload), | |
contentType: "application/json;odata=verbose", | |
headers: { | |
"Accept": "application/json;odata=verbose", | |
"X-RequestDigest" : $("#__REQUESTDIGEST").val(), |
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
var parsedData = []; | |
/*KP: In parsedData we have a key called PsId */ | |
/* KP: Deduplicate */ | |
parsedData.forEach(function(value, key) { | |
var seen = []; | |
for (i=0; i < value.length; i++){ | |
if (seen[value[i].PsId]) { | |
value.splice(i,1); | |
i--; } |
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
http://docs.aws.amazon.com/cli/latest/reference/s3/ls.html | |
Documentation for aws s3 ls | |
AWS have recently release their Command Line Tools. This works much like boto and can be installed using sudo easy_install awscli or sudo pip install awscli | |
Once you have installed, you can then simply run | |
aws s3 ls | |
Which will show you all of your available buckets |
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 | |
# start editable vars # | |
outputfile = "inventory.txt" # file to save the results to | |
folder = "C:\\Users\\[User]\\Documents" # the folder to inventory | |
exclude = ['Thumbs.db','.tmp'] # exclude files containing these strings | |
pathsep = "\\" # path seperator ('/' for linux, '\\' for Windows) | |
# end editable vars # | |
with open(outputfile, "w") as txtfile: |
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
Downloading Visual Studio for an offline installation | |
In most cases, you can install Visual Studio from the download site with no problems. However, in some cases, you may want to download all the update packages before you install them (for example, to install on multiple machines or on an offline machine). The following steps explain how to download all the update packages that you need for an offline installation. | |
After you download the update executable from the MSDN website to a location on your file system, run the following command at a command prompt: <executable name> /layout. | |
This command downloads all the packages for the installation. | |
By using the /layout switch, you can download all the core installation packages, not just the ones that apply to the download machine. This approach gives you all the files that you need to run this update anywhere and may be useful if you want to install components that weren't installed originally. | |
After you run the command, you should be prompted for the download |
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/python | |
import requests, os, pickle, datetime, zipfile, subprocess, csv | |
from bs4 import BeautifulSoup | |
class FeedFetcher(): | |
def __init__(self, ddir=os.getcwd(), get_nj=True, nj_username='', nj_pass=''): | |
self.ddir = ddir | |
self.get_nj = get_nj # whether to fetch from NJ TRANSIT or not | |
self.tc = {} # time checks for GTFS fetches |
NewerOlder