Skip to content

Instantly share code, notes, and snippets.

View oshyshko's full-sized avatar

Alex Shyshko oshyshko

View GitHub Profile
@BertrandDechoux
BertrandDechoux / hadoop-map-reduce.clj
Created August 24, 2012 05:49
Hadoop map-reduce explained with clojure map, reduce and mapcat using the word count example.
; Interested in a short introduction to hadoop mapreduce?
(declare mapreduce)
; Let's look at the "hello world job" ie word count.
(def input [
[1 "hadoop map-reduce explained"]
[2 "with clojure map, reduce and mapcat"]
[3 "using the world count example"]])
@ulasozguler
ulasozguler / remove_sl_icon.sh
Created February 4, 2017 18:58
Remove spotlight icon from menu bar.
cd /System/Library/CoreServices/Spotlight.app/Contents/MacOS
sudo cp Spotlight Spotlight.bak
sudo perl -pi -e 's|(\x00\x00\x00\x00\x00\x00\x47\x40\x00\x00\x00\x00\x00\x00)\x42\x40(\x00\x00\x80\x3f\x00\x00\x70\x42)|$1\x00\x00$2|sg' Spotlight
cmp -l Spotlight Spotlight.bak
sudo codesign -f -s - Spotlight
sudo killall Spotlight
@andrevdm
andrevdm / ghci.conf
Last active February 6, 2018 19:40
GHCi pretty print surviving reload (using :rr) for GHC +8.0
:set -package pretty-show
:set -package hscolour
:set -XOverloadedStrings
:set -XNoImplicitPrelude
:set -XScopedTypeVariables
:set -XTupleSections
:set -fno-warn-type-defaults
:set prompt "λ: "
@lgg
lgg / README.md
Last active June 29, 2024 19:50
Telegram save all media from chat/user/channel

Quick tip. It is possible to download media with small python script.

Goto https://my.telegram.org and generate api id and api hash Install Telethon library with pip3 install telethon Run saveAllMedia.py (replace api_id, api_hash and username with your values).

If you need proxy install https://github.com/Anorov/PySocks pip install PySocks

This code downloads all media from the dialog with username user/chat/channel in current directory.

@wybiral
wybiral / noscript-tracking.go
Last active September 11, 2023 08:53
Tracking cursor position in real-time with remote monitoring (without JavaScript)
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@chrisdone
chrisdone / Intro.md
Last active May 20, 2024 12:44
Statically checked overloaded strings

Statically checked overloaded strings

This gist demonstrates a trick I came up with which is defining IsString for Q (TExp a), where a is lift-able. This allows you to write $$("...") and have the string parsed at compile-time.

On GHC 9, you are able to write $$"..." instead.

This offers a light-weight way to enforce compile-time constraints. It's basically OverloadedStrings with static checks. The inferred return type

@graninas
graninas / haskeller_competency_matrix.md
Last active June 30, 2024 10:13
Haskeller competency matrix