$.ajax({ url: '/my-pretty-url', dataType: 'jsonP' })
.done(function (data, textStatus, jqXHR) {
console.log(data)
})
.fail(function (jqXHR, textStatus, err) {
throw(err)
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
#!/usr/bin/env java --source 23 --enable-preview | |
import java.util.Scanner; | |
/// Find all words in a word list that fit the pattern for the | |
/// [NYT Letter Boxed game](https://www.nytimes.com/puzzles/letter-boxed). | |
/// | |
/// Usage: | |
/// | |
/// cat word-list.txt | ./LetterBoxed abc def hij klm |
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 strict' | |
function F1() { | |
console.log('construct F1') | |
this.name = 'F1' | |
this.f1 = true | |
} | |
// does not call the constructor of F1, works with instanceof | |
function F2() { |
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 std::env; | |
fn main() { | |
let n = env::args() | |
.nth(1) | |
.expect("missing required argument") | |
.parse() | |
.expect("expected a valid number"); | |
let primes = sieve(n); |
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 | |
while read line; do | |
unzip -P $line secret.zip && break | |
done < file.txt |
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 strict' | |
const https = require('https') | |
const IDENTITIES = [ | |
'rdcl.dev', | |
'%.rdcl.dev', | |
'rdcl.nl', | |
'%.rdcl.nl', | |
'ruud.online', |
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 std::cmp::min; | |
use std::collections::HashSet; | |
use crate::graph::Graph; | |
use crate::node::Node; | |
use crate::path::Path; | |
pub fn brute_force(graph: &Graph, from: &Node, to: &Node) { | |
let mut seen = HashSet::new(); |
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 std::str; | |
pub fn read_string_from_buffer<'a>(header: &'a [u8], from: usize, length: usize) -> &'a str { | |
let to = from + length; | |
str::from_utf8(&header[from .. to]).unwrap() | |
} | |
pub fn read_u16_from_buffer(header: &[u8], from: usize) -> u16 { | |
let to = from + 2; | |
let slice = &header[from .. to]; |
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 org.openqa.selenium.By | |
import org.openqa.selenium.JavascriptExecutor | |
import org.openqa.selenium.SearchContext | |
import org.openqa.selenium.WebElement | |
class ByShadow(vararg selectors: String) : By() { | |
private val args = "['" + selectors.joinToString("','") + "']" | |
override fun findElements(ctx: SearchContext): List<WebElement> { |
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> | |
<meta charset="UTF-8"> | |
<title>Dialog</title> | |
<style> | |
html { | |
font-family: sans-serif; | |
font-size: 16px; | |
width: 100%; | |
} |
NewerOlder