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
// before 1.18 | |
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
) | |
func Hosts(cidr string) ([]string, error) { |
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
<!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 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 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 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 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 <alexis.robert@gmail.com> | |
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 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 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 { |
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
// https://nodejs.org/docs/v12.22.10/api/perf_hooks.html | |
const { | |
performance | |
} = require('perf_hooks'); | |
//#1 -- For loop in Javascript. | |
const fish = ['dory', 'bruce', 'marlin', 'nemo']; | |
const nemo = ['nemo']; | |
const everyone = ['dory', 'bruce', 'marlin', 'nemo', 'gill', 'bloat', 'nigel', 'squirt', 'darla', 'hank']; | |
const large = new Array(10).fill('nemo'); |
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
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/bionic64" | |
config.vm.define "docker-1" do |node| | |
node.vm.hostname = "docker-1" | |
config.vm.box_check_update = false | |
config.vm.network "public_network" | |
config.vm.provider "virtualbox" do |vb| | |
vb.name = "docker-1" | |
vb.memory = "2048" |
NewerOlder