Skip to content

Instantly share code, notes, and snippets.

@axhixh
axhixh / job-graph.kk
Created March 5, 2025 01:36
experiment with koka
import std/core/int
import std/os/file
import std/os/path
import std/os/process
struct job
jid: int
name: string
depend-on-self: bool
dependency: int
@axhixh
axhixh / pipe.sml
Last active September 12, 2024 23:53
Pipeline operator `|>` for standardml
infix |> fun x |> f = f x;
fun add x y = x + y;
3
|> add 5
|> add 2
;
@axhixh
axhixh / split_keyboards.md
Created April 25, 2020 00:29 — forked from itod/split_keyboards.md
Every "split" mechanical keyboard currently being sold that I know of
@axhixh
axhixh / Game.fs
Created July 19, 2019 13:29
Coin Flip Game from Functional Programming Simplified book
module Game
open System
type GameState =
{ numFlips : int
numCorrectGuesses : int }
// using this instead of strings like the book
type FlipResult =
@axhixh
axhixh / instalike.js
Created December 28, 2018 01:53 — forked from jadeallencook/instalike.js
Scripts that auto likes posts on instagram via tag.
let likesGiven = 0;
setInterval(() => {
const heart = document.querySelector('.coreSpriteHeartOpen'),
arrow = document.querySelector('.coreSpriteRightPaginationArrow');
if (heart) likesGiven++, heart.click();
arrow.click();
console.log(`You've liked ${likesGiven} post(s)!`);
}, 10000);
@axhixh
axhixh / learning.txt
Created August 29, 2017 00:39
Note on Coursera course on Learning - https://pastebin.com/raw/JNbGxvpQ
Learning How To Learn
Module 1 - What is Learning
Focused/Diffuse Modes Thinking
- Obviously ‘focused’ is when you’re concentrating. Direct approach to solving familiar problems.
- Focused: thoughts move through nicely-paved road of familiar notions (neural pattern looks very tight and directed).
- encompasses rational, sequential, analytical approaches to thinking
- Diffuse: More of a search function neural pattern. Thoughts move widely. More of a broad/big-picture perspective trying to connect ideas from different places.
- We’re always either in focused or diffuse mode of thinking.
@axhixh
axhixh / smtp.py
Created February 15, 2017 23:39
SMTP server for testing
from datetime import datetime
import asyncore
from smtpd import SMTPServer
class EmlServer(SMTPServer):
no = 0
def process_message(self, peer, mailfrom, rpcttos, data):
filename = '%s-%d.eml' % (datetime.now().strftime('%Y%m%d%H%M%S'), self.no)
f = open(filename, 'w')
f.write(data)
@axhixh
axhixh / Dependency.java
Last active April 22, 2017 22:33
Scripts for Processing Maven Dependency upgrade output; "mvn versions:display-dependency-updates > dependency.txt"
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@axhixh
axhixh / reflect.py
Last active April 9, 2016 01:56 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
import os
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
@axhixh
axhixh / trend_places.py
Created March 27, 2016 02:09
Find places for which Twitter has trending topics. Can use the WOEID for the place in the list to get the actual trends.
#!/usr/bin/env python
import json
import tweepy
from tweepy import OAuthHandler
consumer_key = ''
consumer_secret = ''
access_token = ''
access_secret = ''