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/sh | |
set -x | |
node=${1} | |
#nodeName=$(kubectl get node ${node} -o template --template='{{index .metadata.labels "kubernetes.io/hostname"}}') | |
nodeSelector='"nodeSelector": { "kubernetes.io/hostname": "'${node:?}'" },' | |
podName=${USER}-nsenter-${node} | |
kubectl -n kube-system run ${podName:?} --restart=Never -it --rm --image overriden --overrides ' | |
{ | |
"spec": { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Paste Image</title> | |
<script type="text/javascript"> | |
var imageObj = new Image(); | |
window.onload = function() { | |
document.getElementById("pasteTarget"). | |
addEventListener("paste", handlePaste); | |
var canvas = document.getElementById('canvasTarget'); |
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
public static class DateTimeExtensions | |
{ | |
public static DateTime StartOfWeek(this DateTime dt, DayOfWeek startOfWeek) | |
{ | |
int diff = dt.DayOfWeek - startOfWeek; | |
if (diff < 0) | |
{ | |
diff += 7; | |
} |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Animate.css test</title> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/animate.css/3.0.0/animate.min.css"> | |
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
var myButton = $('#button'); |
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
// GET api/<controller> | |
async public Task<string> Get() | |
{ | |
string strResponse = ""; | |
HttpClient client = new HttpClient(); | |
HttpContent responseContent; | |
HttpResponseMessage response; | |
response = await client.GetAsync("https://api.domain.com"); |
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
// GET api/<controller> | |
async public Task<string> Get() | |
{ | |
string strResponse = ""; | |
HttpClient client = new HttpClient(); | |
HttpContent responseContent; | |
HttpResponseMessage response; | |
var requestContent = new FormUrlEncodedContent(new[] { | |
new KeyValuePair<string,string>("text","this is a block of text"), |
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
public static string ToJSON(this object obj) | |
{ | |
JavaScriptSerializer serializer = new JavaScriptSerializer(); | |
return serializer.Serialize(obj); | |
} | |
public static string ToJSON(this object obj, int recursionDepth) | |
{ | |
JavaScriptSerializer serializer = new JavaScriptSerializer(); | |
serializer.RecursionLimit = recursionDepth; |
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
USE [master] | |
ALTER DATABASE [Portal_Sandbox] SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
RESTORE DATABASE [Portal_Sandbox] | |
FROM DISK = N'C:\Portal93013.bak' | |
WITH FILE = 1, | |
MOVE N'Portal' TO N'D:\Data Files\Portal_sandbox.mdf', | |
MOVE N'Portal_log' TO N'D:\Data Files\Portal_sandbox_log.ldf', | |
NOUNLOAD, REPLACE, STATS = 5 |
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
$scope.$watch('variable', function() { | |
if($scope.variable.length > 0) { | |
// greater than zero, now we can enable input fields and such. | |
} | |
}); |
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 | |
(GIT_INDEX_FILE=some-non-existent-file \ | |
git ls-files --exclude-standard --others --directory --ignored -z) | | |
xargs -0 git rm --cached -r --ignore-unmatch -- |
NewerOlder