Skip to content

Instantly share code, notes, and snippets.

View mkhoeini's full-sized avatar

Mohammad Sadegh Khoeini mkhoeini

View GitHub Profile
@ericnormand
ericnormand / 00_script.clj
Last active January 6, 2024 07:13
Boilerplate for running Clojure as a shebang script
#!/bin/sh
#_(
#_DEPS is same format as deps.edn. Multiline is okay.
DEPS='
{:deps {clj-time {:mvn/version "0.14.2"}}}
'
#_You can put other options here
OPTS='
@geekoff7
geekoff7 / rustup.sh
Last active August 9, 2021 22:41
simple script install rust language programming and essential dev tools
#!/usr/bin/env sh
# ************ install rust programming language **************
curl https://sh.rustup.rs -sSf | sh
export PATH="$HOME/.cargo/bin:$PATH"
# ************** install stable rust component ****************
rustup component add rustfmt
rustup component add clippy
rustup component add rls
rustup component add rust-src
@halgari
halgari / gist:c17f378718cbd2fd82324002133ef678
Created November 23, 2018 20:54
Contributing to Clojure

So you’d like to contribute to Clojure, great! Let’s talk about what that involves.

The first thing you’ll want to make sure is that your idea is valid, and that you won’t spend a ton of time working on something that won’t make into master. To do this, you should create a JIRA ticket. For example, let’s say we want to improve how core.async handles channel closing propagation. It’s not a super complex problem, but there are some design questions about which of the various semantics currently in place should be the default, and if some semantics should be configurable.

So start by making a JIRA ticket and stating what the problem is you’re trying to solve, what the possible options for solving the problem. Now hit save and wait for the ticket to be triaged. Alex Miller will take a look when he can, and that can take a few days to a few weeks, depending on the time of the year (he has other responsibilities). Alex may out-right reject the idea if he knows Rich would never approve the ticket, but otherwise h

@yelouafi
yelouafi / multishot-callcc.js
Created September 21, 2018 17:05
multi shot continuations
function isGenerator(x) {
return x != null && typeof x.next === "function"
}
function isFrame(x) {
return x != null && x._type_ === 'call_frame'
}
function call(genFunc, ...args) {
{:deps
{org.clojure/clojure {:mvn/version "1.9.0"}
com.datomic/datomic-free {:mvn/version "0.9.5697"}}}
@mfikes
mfikes / README.md
Last active May 24, 2018 12:20
add-lib ClojureScript
clj -Sdeps '{:deps {github-mfikes/a69c72e65330e92625bfa81d5501dad4 {:git/url "https://gist.github.com/mfikes/a69c72e65330e92625bfa81d5501dad4" :sha "700c681f61eae580be3f52181e15c221fa23b77c"}}}' -m cljs.main -re node -r

This sets you up to use Alex Miller's new add-lib capability, hacked into a revision of ClojureScript.

Once the REPL is running, call add-lib to dynamically require a Git Dep library (or a :mvn/version, or a :local/root dep):

cljs.user=> (require '[cljs.repl :refer [add-lib]])
@GFoley83
GFoley83 / deferred-promise.ts
Created April 26, 2018 07:37
Deferred Promise for Typescript
/**
* A new instance of deferred is constructed by calling `new DeferredPromse<T>()`.
* The purpose of the deferred object is to expose the associated Promise
* instance APIs that can be used for signaling the successful
* or unsuccessful completion, as well as the state of the task.
* @export
* @class DeferredPromise
* @implements {Promise<T>}
* @template T
* @example
@bhb
bhb / README.md
Last active May 15, 2023 01:28
Clojure friendly mode, inspired by https://github.com/slipset/friendly
@mszajna
mszajna / look_ma_no_frameworks.clj
Last active March 15, 2018 07:15
Clojure reloaded workflow without libraries
(extend-type Object
Closable
(.close [o] o))
(defn closable-jetty [server]
(reify Closable (close [_] (.stop server))))
(defn start []
(let [system (promise)]
(future
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2