I hereby claim:
- I am hafthor on github.
- I am hafthor (https://keybase.io/hafthor) on keybase.
- I have a public key whose fingerprint is 02E0 BCF1 DB0D 866C 348D 9414 BA7B 4402 329E 8B25
To claim this, I am signing this object:
| var http = require('http'); | |
| http.createServer(function (req, resp) { | |
| var h = req.headers; | |
| h.host = "stackoverflow.com"; | |
| var req2 = http.request({ | |
| host: h.host, port: 80, path: req.url, method: req.method, headers: h | |
| }, function (resp2) { | |
| resp.writeHead(resp2.statusCode, resp2.headers); | |
| resp2.on('data', function (d) { resp.write(d); }); | |
| resp2.on('end', function () { resp.end(); }); |
| <%@ Page Language="VB" %> | |
| <!DOCTYPE html> | |
| <html> | |
| <head><title></title> | |
| <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" /> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
| <link rel="stylesheet" href="http://jquerymobile.com//test/css/themes/default/" /> | |
| <script src="http://jquerymobile.com//test/js/jquery.js"></script> | |
| <script src="http://jquerymobile.com//test/js/"></script> |
| Public Function CalculatePasswordHash(password As String, usernameOrId As String) As Byte() | |
| Static saltBytes = New Byte() {&HDE, &HAD, &HC0, &HDE} | |
| Static h As New SHA512CryptoServiceProvider | |
| Dim o(0 To h.HashSize \ 8 - 1) As Byte | |
| Dim usrBytes = UTF8Encoding.UTF8.GetBytes(usernameOrId) | |
| Dim pwdBytes = UTF8Encoding.UTF8.GetBytes(password) | |
| SyncLock h | |
| h.Initialize() | |
| h.TransformBlock(usrBytes, 0, usrBytes.Length, o, 0) | |
| h.TransformBlock(saltBytes, 0, saltBytes.Length, o, 0) |
| public RethrowingCatch() { | |
| this.dependency = new Dependency(); | |
| try { | |
| this.dependency.SomeProperty = "Blah"; | |
| } catch (Exception) { | |
| dependency.Dispose(); | |
| throw; | |
| } | |
| } |
| // Copyright (c) 2008-2022 Hafthor Stefansson | |
| // Distributed under the MIT/X11 software license | |
| // Ref: http://www.opensource.org/licenses/mit-license.php. | |
| static unsafe bool UnsafeCompare(byte[] a1, byte[] a2) { | |
| unchecked { | |
| if(a1==null || a2==null || a1.Length!=a2.Length) | |
| return false; | |
| fixed (byte* p1=a1, p2=a2) { | |
| byte* x1=p1, x2=p2; | |
| int l = a1.Length; |
I hereby claim:
To claim this, I am signing this object:
| var luhnMap = ['0246813579','0123456789']; | |
| function luhnCheck(value) { | |
| value = value.replace(/\D/g, ''); | |
| return luhnDigit(value.slice(0, -1)) === value.slice(-1); | |
| } | |
| function luhnDigit(value) { | |
| return ('' + value.replace(/\D/g, '').split('').reverse().map(function(d, i) { | |
| return -luhnMap[i % 2][+d]; |
| function searchmap(separator) { | |
| var map = {}; | |
| (location.search || '') | |
| .split("&") | |
| .forEach(function(x) { | |
| var kv = x.split('='), k = kv[0], v = decodeURIComponent(x.substr(k + 1)); | |
| if (separator === undefined) | |
| if (map[k]) | |
| map[k] = [v]; | |
| else |
| // StringConcat.java | |
| public class StringConcat { | |
| public static void main(String[] args) { | |
| String abc = getA() + getB() + getC(); | |
| System.out.println(abc); | |
| } | |
| private static String getA() { | |
| return "ABC"; | |
| } |