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
def test_put_detail_without_pk(self): | |
payload = self.dailytotal_post_data.copy() | |
payload['carbohydrate'] = 69 | |
# I'd like to support PUT to create on detail resources. | |
# If there's no pk on the payload for a PUT, tastypie will create it. | |
# However, there needs to be a token for the pk for the route to match the resource detail route. | |
# How gross is throwing in a pk that cannot exist in the url, just to get the route to match? | |
# I haven't had to break out the tastypie source code yet today, and I kind of want to keep it that way | |
resp = self.api_client.put('/api/v1/dailytotal/-1/', format='json', data=payload) |
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 New-LogicalisMonitoringSuppression{ | |
[cmdletbinding()] | |
Param( | |
[String[]] | |
[Parameter(Mandatory=$true)] | |
$Server, | |
$ShowBrowser = $False | |
) | |
begin{} | |
process{ |
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
Set-location "C:\Assemblies" | |
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") | |
$publish = New-Object System.EnterpriseServices.Internal.Publish | |
$assemblyPaths = Get-ChildItem -recurse | select FullName | where { $_.FullName -like "*.dll" } | |
foreach ($assembly in $assemblyPaths) | |
{ | |
$publish.GacInstall($assembly.FullName) | |
} |
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
//the variable "oversimplifiedModule" gets assigned the return value of the anonymous and self executing function | |
var oversimplifiedModule = (function(){ | |
//"private" variables are declared within the scope of the anonymous function: "counter" will not be in the global scope. | |
var counter = 42; | |
//the return value of the anonymous function can be considered the modules "public" interface | |
return { | |
incrementCounter: function(){ | |
//because we refer to "counter", which is in the outer scope, inside this inner scope, a closure is formed, which keeps a reference to "counter" | |
//and prevents it from being garbage collected. closures are very neat and useful. |
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
$.post( "/endpoint/url/goes/here", | |
{ | |
message: "this is an object full of data that you're POST'ing to the server", | |
A: 69, | |
S: true, | |
L: "your dreams" | |
}, | |
function( data ) { | |
console.log("we're in the success callback! everything is fine!"); | |
console.log("here's what the server returned:", data); |
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
<html> | |
<head> | |
<title>My Site!</title> | |
</head> | |
<body> | |
<img id="mainpicture" src="http://girldevelopit.com/assets/pink-logo.png"> | |
<br/> | |
<a href="#" onclick="favoriteThings()"> | |
Favorite Things | |
</a> |
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
<html> | |
<head> | |
<title>My Site!</title> | |
<script src="myjavascriptfile.js"></script> | |
</head> | |
<body> | |
<a href = "#" onclick="calculate()"> | |
Calculate life time supply | |
</a> | |
</body> |
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
var myAge = 27; | |
var maxAge = 100; | |
var coffeePerDay = 2; | |
var lifetimeSupply = (maxAge - myAge) * coffeePerDay * 365; | |
if (lifetimeSupply > 40000){ | |
alert("you drink too much coffee"); | |
} else { | |
alert("you'll probably be fine"); |
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
var myAge = 27; | |
var maxAge = 100; | |
var coffeePerDay = 2; | |
var lifetimeSupply = (maxAge - myAge) * coffeePerDay * 365; | |
var message = "You will need " + lifetimeSupply + " cups of coffee to last until your old age of " + maxAge; | |
alert(message); |
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
<html> | |
<head> | |
<title>My Site!</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script> | |
<script src="main.js"></script> | |
</head> | |
<body> | |
<div id="friendMessage"></div> | |
<a id="calculationLink" href="#" onclick="calculate()">dust calculation</a> | |
<a href="#" onclick="favoriteThings()">favorite things</a> |