Skip to content

Instantly share code, notes, and snippets.

View klarkc's full-sized avatar

KlarkC klarkc

View GitHub Profile
@chiroptical
chiroptical / babyShark.hs
Last active February 3, 2023 15:23
Baby shark as a Haskell program
{-# LANGUAGE BlockArguments #-}
module Main where
main :: IO ()
main = do
babyShark
do do do do do do babyShark
do do do do do do babyShark
do do do do do do babyShark
@chexxor
chexxor / purescript-lazy-load-modules-idea.md
Last active May 3, 2022 14:39
PureScript Lazy-load Modules Idea

Lazy/Dynamic Loadable Modules in PureScript

Motivation

https://discourse.purescript.org/t/lazy-loading-routes-in-tea-style-app/141/2

Ideas

  • Here, we aren't first-class modules, because we are still using the normal module definition and import system. We believe that first-class modules refer to a special feature in OCaml.
  • Can not refer to type classes across a lazy-load boundary. Type-class instances and classes are not first-class values.
@navid-taheri
navid-taheri / eb-cli-ubuntu-16-04
Last active July 6, 2023 14:19
How to install eb cli (awsebcli) on Ubuntu 16.04
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install python3-setuptools
sudo easy_install3 pip
pip -V
#pip 9.0.1 from /usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg (python 3.5)
sudo chown -R username:username ~/.local/
# add to ./*shrc
@mosquito
mosquito / README.md
Last active May 24, 2024 17:00
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@Shamaoke
Shamaoke / producer_consumer.js
Last active March 13, 2020 02:21
Producer-Consumer Problem Solved with JavaScript
import { EventEmitter } from 'events'
let cycle = 0
let emitter = new EventEmitter
emitter.on( 'produce', function(v) { console.log(`produce ${v}`) } )
emitter.on( 'consume', function(v) { console.log(`consume ${v}`) } )
emitter.on( 'full', function(arr) { consumer(arr).next() } )
@staltz
staltz / introrx.md
Last active May 24, 2024 07:56
The introduction to Reactive Programming you've been missing
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@samuelsimoes
samuelsimoes / gist:3011642
Created June 28, 2012 14:19
Ajax no Wordpress. Faça do jeito certo!

#Ajax no Wordpress

###functions.php (ou arquivo incluído)

<?php

#Registra o seu script com o seu ajax no functions.php, no meu caso samuel.js
wp_register_script('samuel', get_bloginfo('template_directory') . "/scripts/samuel.js", array('jquery'));