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.yaml.snakeyaml.Yaml; | |
import java.io.FileNotFoundException; | |
import java.io.FileInputStream; | |
import java.io.File; | |
import java.util.Map; | |
public class HelloYaml { | |
@SuppressWarnings("unchecked") | |
public static void main(String[] args) throws FileNotFoundException { |
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 lang="en"> | |
<head> | |
<!-- https://hakk.dev/blog/posts/html-table-filter/ --> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Table Filter</title> | |
<style> | |
table { | |
border-collapse: collapse; |
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
// before 1.18 | |
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
) | |
func Hosts(cidr string) ([]string, error) { |
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> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Hello, World!</title> | |
<style type="text/css"> | |
html { | |
color-scheme: light dark; | |
} |
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> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>List Files</title> | |
<style type="text/css"> | |
.table { | |
/* Remove spacing between table cells (from Normalize.css) */ | |
border-collapse: collapse; |
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
#include <iostream> | |
class Greeting { | |
public: | |
void say_hello() { | |
using std::cout; | |
using std::endl; | |
int hw[13] = {72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33}; | |
for (int i = 0; i < 13; i++) { | |
cout << char(hw[i]); |
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 math | |
class deciamlRounding(): | |
def __init__(self, nums = [3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 13.5, 14.5, 15.5, 16.5, 17.5, 18.5, 19.5, 20.5, 21.5, 22.5, 24.5, 25.5]): | |
self.nums = nums | |
# hold the averages | |
self.no_rounding_avg = float(0.0) |
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
/* Tiny web server in Golang for sharing a folder | |
Copyright (c) 2010 Alexis ROBERT <[email protected]> | |
Contains some code from Golang's http.ServeFile method, and | |
uses lighttpd's directory listing HTML template. */ | |
package main | |
import ( | |
"compress/gzip" |
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
<?php | |
$records = dns_get_record("abc.xyz", DNS_MX); | |
foreach ($records as $rec) { | |
print($rec['host']."\n"); | |
print($rec['type']."\n"); | |
print($rec['pri']."\n"); | |
print($rec['target']."\n"); | |
print($rec['class']."\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
<?php | |
// https://leetcode.com/problems/two-sum/ | |
function solution($nums, $target) { | |
$memo = array(); | |
for ($i = 0; $i < count($nums); $i++) { | |
$key = $target - $nums[$i]; | |
if (array_key_exists($nums[$i], $memo)) { | |
return array($memo[$nums[$i]], $i); | |
} else { |
NewerOlder