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
#Forces any http request to be rewritten using https | |
RewriteEngine On | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
#also forces directly linked resources (images, css, etc.) to use https | |
#RewriteEngine On | |
#RewriteCond %{HTTPS} !=on | |
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
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
Option Explicit | |
Dim objShell, RegLocate, RegLocate1 | |
Set objShell = WScript.CreateObject("WScript.Shell") | |
On Error Resume Next | |
RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer" | |
objShell.RegWrite RegLocate,"","REG_SZ" | |
RegLocate = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable" | |
objShell.RegWrite RegLocate,"0","REG_DWORD" | |
WScript.Quit |
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
SELECT | |
/*Tday Value as it appears in db*/ | |
lmtday as tday, | |
' 24 HR Format hh:mm:ss ' as format1, | |
/*24 Hour Time Format*/ | |
/*get Hours*/ | |
SUBSTR ((RIGHT (REPEAT ('0',6) || lmtday,6)),1,2) as HH24, | |
/*get Minutes*/ | |
SUBSTR ((RIGHT (REPEAT ('0',6) || lmtday,6)),3,2) as MM24, | |
/*get Seconds*/ |
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
$dirName = "<directory path>" | |
Write-Host Exporting solutions to $dirName | |
foreach ($solution in Get-SPSolution) | |
{ | |
$id = $Solution.SolutionID |
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
//The parameter weekday is true if it is a weekday, and the parameter vacation is true if we are on vacation. We sleep in if it is not a weekday or we're on vacation. Return true if we sleep in. | |
public boolean sleepIn(boolean weekday, boolean vacation) { | |
return !weekday||vacation ? true: false; | |
} | |
//Given an int n, return the absolute difference between n and 21, except return double the absolute difference if n is over 21. |
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
$path = "C:\example" | |
$out = "C:\exampleout.txt" | |
Get-ChildItem $path -Filter *.sql| % { | |
$file = $_.Name | |
" " | Out-File -Append $out | |
"-----------------------------------" | Out-File -Append $out | |
"--${file}:" | Out-File -Append $out | |
" " | Out-File -Append $out | |
Get-Content $_.FullName | % { |
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 class BasicStack<X> { | |
private X[] data; | |
private int stackPointer; | |
public BasicStack() { | |
data = (X[]) new Object[1000]; | |
stackPointer = 0; | |
} | |
public void push(X newItem) { |
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> | |
<body> | |
<h2>The % Operator</h2> | |
<p id="demo"></p> | |
<p id="demo1"></p> | |
<p id="demo2"></p> | |
<p id="demo3"></p> |
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
package ds; | |
public class BasicBinaryTree<X extends Comparable<X>> { | |
private Node root; | |
private int size; | |
public BasicBinaryTree() { | |
this.root = null; | |
} |
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 java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; | |
public class dateexample { | |
public static void main(String[] args) { | |
System.out.println(getdate()); | |
System.out.println(getdate(0)); | |
System.out.println(getdate(1)); | |
System.out.println(getdate(-1)); |