Skip to content

Instantly share code, notes, and snippets.

View hantuzun's full-sized avatar
🥽
Burnt out

Han Tuzun hantuzun

🥽
Burnt out
View GitHub Profile
@mayneyao
mayneyao / notion2blog.js
Last active June 15, 2024 02:51
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@kamranahmedse
kamranahmedse / email-service-providers
Created February 9, 2016 08:11
Email Service Providers
gmail.com
yahoo.com
hotmail.com
aol.com
msn.com
live.co.uk
live.com.au
facebook.com
live.com
yahoo.ca
@awohletz
awohletz / core.cljs
Created December 10, 2014 02:46
Om routing with Secretary
(ns om-routing.core
(:require-macros [secretary.core :refer [defroute]]
[cljs.core.async.macros :refer [go go-loop]])
(:require [om.core :as om :include-macros true]
[om-tools.core :refer-macros [defcomponent]]
[sablono.core :as h :refer-macros [html]]
[secretary.core :as secretary :include-macros true]
[goog.events :as events]
[goog.history.EventType :as EventType]
[cljs.core.async :refer [put! chan <! pub sub]])
@wdullaer
wdullaer / install.sh
Last active April 2, 2024 20:33
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@staltz
staltz / introrx.md
Last active June 21, 2024 12:27
The introduction to Reactive Programming you've been missing
@fehmicansaglam
fehmicansaglam / 1_Good parts
Last active August 29, 2015 14:00
Why I think scalatutorials.com uses the wrong way to teach Scala
Step by step tutorial, the UX, and the worksheet are great.
(Although the worksheet did not run for some of the lessons on my Chrome, Ubuntu 14.04)
@shinmuro
shinmuro / mutable-deftype.clj
Last active January 5, 2021 22:10
Clojure deftype that has mutable field and setter method sample.
(defprotocol IEditName
(get-name [this])
(set-name! [this val]))
(deftype PersonName [^:volatile-mutable lname]
IEditName
(get-name [this] (. this lname))
(set-name! [this val] (set! lname val)))
(def pname (PersonName. "hoge"))
@swannodette
swannodette / gist:3217582
Created July 31, 2012 14:52
sudoku_compact.clj
;; based on core.logic 0.8-alpha2 or core.logic master branch
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
@wrunk
wrunk / jinja2_file_less.py
Last active September 19, 2023 15:05
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@daddz
daddz / file_queue.rb
Created April 1, 2010 23:23
a ruby queue based on a file
class FileQueue
def initialize(file_name)
@file_name = file_name
end
def push(obj)
safe_open('a') do |file|
file.write(obj + "\n")
end