Skip to content

Instantly share code, notes, and snippets.

View ardfard's full-sized avatar

Ardin Fardiansyah ardfard

View GitHub Profile
@ardfard
ardfard / FAQ.md
Created January 29, 2025 09:21 — forked from ngxson/FAQ.md
convert ARM NEON to WASM SIMD prompt

Why did you do this?

Relax, I only have one Sunday to work on idea, literally my weekend project. So I tried Deepseek to see if it can help. Surprisingly, it works and it saves me another weekend...

What is your setup?

Just chat.deepseek.com (cost = free) with prompts adapted from this gist.

Does it work in one-shot or I have to prompt it multiple times?

@ardfard
ardfard / FPGuild-ex.hs
Created December 21, 2017 11:57
FP Guild exercise part 1
#! /usr/bin/env stack
-- stack --resolver lts-9.5 script
---------- EX 1 -------------------
pascal :: Int -> Int -> Int
pascal c r
| c == 0 = 1
| r == c = 1
| otherwise = pascal (c - 1) (r - 1) + pascal c (r - 1)
@ardfard
ardfard / sum.hs
Created July 14, 2016 03:18
sigma function using state monad
import Control.Monad.State
sum' xs = flip execState 0 $ do
forM_ xs $ \x -> do
current <- get
put (current + x)
main = print $ sum' [1,2,3]
version: '2'
services:
beanstalkd:
image: schickling/beanstalkd
volumes:
- beanstalk-data:/data
command: beanstalkd -p 11300 -b /data
beanstalkd-console:
image: schickling/beanstalkd-console
-- Enter your code here. Read input from STDIN. Print output to STDOUT
{-# Language OverloadedStrings #-}
import Control.Monad
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import qualified Data.Text.Read as TR
main :: IO()
main = parseInput >>= (mapM_ print) . applySolution
@ardfard
ardfard / project_001
Created October 12, 2014 07:33
Project Euler solutions in haskell
dummy
main = print "Hello, world!"