Skip to content

Instantly share code, notes, and snippets.

@AshyIsMe
AshyIsMe / README.md
Last active December 15, 2015 15:38 — forked from mbostock/.block

Designed to be viewed from bl.ocks.org - http://bl.ocks.org/ashyisme/5282701

I've added random points to this map that animate through, enter(), update() and exit() data binding from d3js. This shows how to display points on a map directly from an array of latitude/longitude points: [[137, 80], [-80, 80] ...].

This map shows the Natural Earth Admin 0 - Countries shapefile at 50m resolution. Converted to TopoJSON, only 140K gzipped. Each country is identified by its ISO 3166-1 numeric code.

@AshyIsMe
AshyIsMe / README.md
Last active December 15, 2015 21:49

#Fun with web scraping and text to speech

Recently I discovered the OSX say command. This command is pretty funny to play around with. Open up a terminal and type the following command:

  say "I cant let you do that dave"

This is fun to play with but let's see if we can make it into something useful aswell. I'm also interested in the aussie shares market (www.asx.com.au) so let's see if we can make it read out something useful like the latest breaking news for some shares that we are interested in.

module Scraper
where
import Network.HTTP
import Control.Applicative
baseurl = "http://ichart.finance.yahoo.com/table.csv?d=9&e=25&f=2013&g=d&a=8&b=8&c=2010&ignore=.csv&s=" --MAD.AX
-- fetch via GET
@AshyIsMe
AshyIsMe / ghci
Created March 6, 2015 06:13
haskell lazy evaluation
λ: let numbers = [1..10]
λ: numbers
[1,2,3,4,5,6,7,8,9,10]
λ: filter (== 5) numbers
[5]
λ: take 1 $ filter (== 5) numbers
[5]
λ: take 1 $ filter (== 50) numbers
[]
λ:
$ node test_promises.js
exiting you focker!
Meaning of life: 42
@AshyIsMe
AshyIsMe / default.nix
Last active September 28, 2018 12:38
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "env";
env = buildEnv { name = name; paths = buildInputs; };
buildInputs = [
php
# stdenv
gcc7
openssl
openssl.dev
with import <nixpkgs> { };
pkgs.mkShell {
buildInputs = [
redis
postgresql
(python3.withPackages
(ps: [
@AshyIsMe
AshyIsMe / crappy-fzf.ijs
Created April 12, 2020 03:51
crappy-fzf.ijs - apl J lang - levenshtein distance based best match finding
#!/usr/bin/env jconsole
NB. https://code.jsoftware.com/wiki/Essays/Levenshtein_Distance
NB. version producing only scalar distance
levdist=: 4 : 0 " 1
'a b'=. (/: #&>)x;y
z=. >: iz =. i.#b
for_j. a do.
@AshyIsMe
AshyIsMe / janimation1.ijs
Created April 10, 2021 00:31
Animation in J
NB. Code from the "Basic Animation In J" video
NB. https://www.youtube.com/watch?v=uL-70fMTVnw
NB. ---------------------------------------------------------
NB. animation demo
load 'viewmat'
coinsert'jgl2'
wd 'pc w0 closeok' NB. parent control (window) named 'w0'
NB. http://oeis.org/A342260
a =: verb : '0 } I. y = +/"1 (y-1) = y #.inv ^&2 (i.y^(y+1))' "0
a 2
3
a 3
31
a 4
217
a 5