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
const std = @import("std"); | |
pub fn Matrix(comptime T: type, width: usize, height: usize) type { | |
return struct { | |
const Self = @This(); | |
width: usize = width, | |
height: usize = height, | |
array: [height * width]T = undefined, | |
slice: MatrixSlice(T) = MatrixSlice(T){ |
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
const std = @import("std"); | |
const size = 64; | |
var targetBase: [size]u8 = undefined; | |
var srcBase: [size]u8 = []u8{42} ** size; | |
export var target = targetBase[0..size]; | |
export var src = srcBase[0..size]; |
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
func WriteResponse(w io.Writer, st Status, headers []Header, body io.Reader) error { | |
_, err := fmt.Fprintf(w, "HTTP/1.1 %d %s\r\n", st.Code, st.Reason) | |
if err != nil { | |
return err | |
} | |
for _, h := range headers { | |
_, err := fmt.Fprintf(w, "%s: %s\r\n", h.Key, h.Value) | |
if err != nil { | |
return err |
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
(module | |
(type (;0;) (func)) | |
(type (;1;) (func (param i32) (result i32))) | |
(type (;2;) (func (param i32))) | |
(func $__wasm_call_ctors (type 0)) | |
(func $abort (type 0) | |
unreachable | |
unreachable) | |
(func $sbrk (type 1) (param i32) (result i32) | |
block ;; label = @1 |
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
((()())(()())(()())(()())(()())(()())(()())(()())((())())()(()())(()())(()())(() | |
())((())())()(()())(()())()(()())(()())(()())()(()())(()())(()())()(()())(())(() | |
)(())(())((()))(()(()))()(()())()(()())()((()))()()(()())((())())(())(()(()))(() | |
)((()))(()(()))()()(()()())()((()))((()))((()))(()()())(()())(()())(()())(()())( | |
()())(()())(()())(()()())(()()())(()())(()())(()())(()()())()()(()()())(())((()) | |
)(()()())(())(()()())(()())(()())(()())(()()())((()))((()))((()))((()))((()))((( | |
)))(()()())((()))((()))((()))((()))((()))((()))((()))((()))(()()())()()(()())(() | |
()())()(()())(()())(()()())) |
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
_.prototype.then = function(...args) { return Promise.resolve(this.value()).then(...args) } | |
/* | |
async function convert(array) { | |
const converted = await _.chain(array) | |
.filter(x => x % 2) | |
.map(x => x * 2) | |
} | |
*/ |
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
Project.joins( | |
activities: Activity.active.group(:project_id).select(:project_id, 'COUNT(*) as "count"') | |
).where(activities: { count: [1..2, 3..4] }) |
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
#!/bin/bash | |
target_ip=255.255.255.255 | |
whitelist=( | |
localhost.localdomain | |
local | |
localhost | |
broadcasthost | |
0.0.0.0 |
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
``` | |
✖ rejects after timeout | |
HeadlessChrome 0.0.0 (Mac OS X 10.12.6) | |
TypeError: { __flags: | |
{ ssfi: [Function: proxyGetter], | |
lockSsfi: undefined, | |
object: {}, | |
message: undefined }, | |
assert: [Function], | |
__methods: |
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
from functools import partial | |
class l(object): | |
def __init__(self, func, *args, **kwargs): | |
self.func = func | |
self.args = args | |
self.kwargs = kwargs | |
def __ror__(self, lhs): | |
return self.func(lhs, *args, **kwargs) |
NewerOlder