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
using System; | |
using System.IO; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Linq; | |
namespace CryptoTest | |
{ | |
class Program | |
{ |
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 txt = "Dette vil slette elevtelling og all tilhørende elevdata. Ønsker du å fortsette?"; | |
function regexSplit(re, txt) { | |
var reg = new RegExp(re); | |
var result = []; | |
var last; | |
var ar; | |
while(ar = reg.exec(txt)) { | |
result.push(ar[1]); | |
last = reg.lastIndex; |
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> | |
<script> | |
var a = "</script><script>alert(1)</script>"; | |
</script> | |
</html> | |
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
public class Person { | |
public final String navn; | |
public Person(String navn) { | |
this.navn = navn; | |
} | |
} | |
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 preflight(uri) | |
#For some reason this speeds up connect on windows | |
require 'socket' | |
context = OpenSSL::SSL::SSLContext.new | |
tcp_client = TCPSocket.new uri.host, uri.port | |
ssl_client = OpenSSL::SSL::SSLSocket.new tcp_client, context | |
ssl_client.connect | |
end |
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 mynamespace = mynamespace || {}; | |
(function(){ | |
var counter = { count: 0 }; | |
function incrementCounter(){ | |
counter.count++; | |
} | |
mynamespace.someobject = { | |
counter : counter, |
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
a = "javascript:evil();\nhttp://www.vg.no" | |
if a =~ /^https?/ then | |
puts "This is a safe url starting with http or https" | |
end |
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 oldCreateElement = document.createElement; | |
document.createElement = function() { | |
var element = oldCreateElement.apply(document, arguments); | |
var oldSetAttribute = element.setAttribute; | |
console.log(arguments, element); | |
element.setAttribute = function(name, value) { | |
if (name == "onsubmit") { | |
console.log(arguments.callee.caller.toString()); | |
} | |
oldSetAttribute.apply(element, arguments); |
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
public class Dog { | |
private Tail tail; | |
private Head head; | |
public Dog() { | |
this(new TailImpl(), new HeadImpl()) | |
} | |
public Dog(Tail tail, Head head) { | |
this.tail = tail; | |
this.head = head; |
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
package no.posten.dpost.sosm; | |
import java.io.ByteArrayInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.URL; | |
import java.security.AccessController; | |
import java.security.CodeSigner; | |
import java.security.CodeSource; | |
import java.security.PrivilegedAction; |
OlderNewer