Skip to content

Instantly share code, notes, and snippets.

View Khazl's full-sized avatar

Guido Khazl

  • GG
  • Germany
View GitHub Profile
@Khazl
Khazl / index.js
Last active May 10, 2021 13:17
Daily Notes. Script which creates a markdown file based on the current date and starts the editor.
const fs = require('fs')
const { exec } = require('child_process')
function paddedZero(value) {
return (`0${value}`).slice(-2)
}
let today = new Date()
today = `${today.getFullYear()}-${paddedZero(today.getMonth()+1)}-${paddedZero(today.getDate())}`
/*
Usage:
$ node crawler.js <url> <filename>
Example:
$ node crawler.js "https://jsonplaceholder.typicode.com/users" "users.json"
*/
const https = require('https');
const fs = require('fs');
$activities = array(
0 => 'None',
1 => 'Manufacturing',
2 => 'Researching Technology',
3 => 'Researching Time Efficiency',
4 => 'Researching Material Efficiency',
5 => 'Copying',
6 => 'Duplicating',
7 => 'Reverse Engineering',
8 => 'Invention',
@Khazl
Khazl / ores.php
Last active December 7, 2017 14:32
Ores API
<?php
$today = date("Y-m-d");
$file = "archive/".$today.".json";
if (!file_exists($file)) {
$ores = [
18 => 'Plagioclase',
19 => 'Spodumain',
20 => 'Kernite',