Skip to content

Instantly share code, notes, and snippets.

View keyvanakbary's full-sized avatar

Keyvan Akbary keyvanakbary

View GitHub Profile
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@pbostrom
pbostrom / cljs-npm.md
Last active March 8, 2024 07:53
Loading third-party npm modules in ClojureScript

Loading third-party npm modules in ClojureScript

This example shows how to load the re-resizable npm module which provides a resizable React component. Requires the lein-npm plugin.

  1. Add the npm module to the :npm :dependencies section of project.clj:
 :npm {:package {:scripts {:build "webpack -p"}}
       :dependencies [[react "16.4.0"]
                      [react-dom "16.4.0"]
                      ["@cljs-oss/module-deps" "1.1.1"]
@gregoryyoung
gregoryyoung / gist:a3e69ed58ae066b91f1b
Created June 24, 2015 13:25
Event Sourcing as 3 functions.
f(events) -> state
match f(state, event) -> state
f(state, command) -> events
@syrusakbary
syrusakbary / fib.rb
Last active April 21, 2016 05:46
Fibonacci algorithm in O(1) ;)
SQRT_5 = Math.sqrt(5)
GOLDEN_NUMBER = (1+SQRT_5)/2
def fib(n)
(1/SQRT_5*(GOLDEN_NUMBER**n-(-1/GOLDEN_NUMBER)**n)).to_i
end
puts fib(7)
@bluepapa32
bluepapa32 / build.gradle
Created December 24, 2011 07:05
Apache Lucene DEMO with Gradle
configurations {
demo
source
}
repositories {
mavenCentral()
}
dependencies {
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\e[0;32m\]'
c_path='\[\e[1;34m\]'
c_git_clean='\[\e[0;37m\]'
c_git_staged='\[\e[0;32m\]'
c_git_unstaged='\[\e[0;31m\]'
else
c_reset=