Skip to content

Instantly share code, notes, and snippets.

View alekrutkowski's full-sized avatar

alek alekrutkowski

View GitHub Profile
@rondevera
rondevera / gmail_bookmarklet.js
Created June 26, 2009 03:58
Gmail bookmarklet: For quickly e-mailing the current page's URL (and the selected text, if any) via Gmail.
/*
Gmail bookmarklet
rondevera.com
For quickly e-mailing the current page's URL (and the selected text, if any)
via Gmail.
Usage:
- Create a new item in your bookmark bar with the name "Gmail" (or just "Gm",
or your favorite Unicode character), and the code below as the location.
@maurer
maurer / Modules.lhs
Created April 5, 2012 18:03
Embedding first class modules in Haskell
>{-# LANGUAGE TypeFamilies, ScopedTypeVariables #-}
>module Modules where
Since all modules under this translation must ascribe to some signature,
we by providing a signature for a module which provides equality over
some type.
>class EQ mod where
> type EQV mod :: *
> eq :: mod -> EQV mod -> EQV mod -> Bool
@keyz
keyz / y.r
Created February 26, 2015 05:39
Y Combinator in R
## fact <- function(x) {
## if (x == 1) {
## 1
## }
## else {
## x * fact(x - 1)
## }
## }
## fact(5)
@kpym
kpym / Copy code from SX v2.user.js
Last active March 31, 2023 11:27
Greasemonkey : Add copy code button in stackexchange.com (SX).
// ==UserScript==
// @name Copy code from SX
// @namespace https://gist.github.com/kpym/30d90be41ab5c248cdf7
// @version 0.3
// @description This script use clipboard.js to add copy button for code sections on SX. When you hover a code the button "</>" appear on the top right corner. Click it and the code is copied.
// @author kpym
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
// @match *://*.superuser.com/*
// @match *://*.serverfault.com/*
@junagao
junagao / vscode-italic-font-settings.md
Last active June 26, 2024 10:34
VSCode italic font settings

VSCode italic font settings

Add this to settings.json (cmd ,):

{
  "editor.fontFamily": "Operator Mono, Fira Code iScript, Menlo, Monaco, 'Courier New', monospace",
  "editor.fontLigatures": true,
  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
@redblobgames
redblobgames / make-instagram-photos.sh
Created June 2, 2019 03:02
Turn a panoramic photo into several square photos for Instagram, so that when you scroll they look like one seamless photo
#!/bin/bash
# As of 2017 Feb, Instagram allows multiple photos to be posted side by side.
# @idealisms posted some panoramas split up into separate photos.
# I wrote this script to generate those square photos from a panorama.
if [ -z "$1" ]; then
echo "Usage: $0 filename.jpg"
exit
fi
# to create the plots in this Twitter thread: https://twitter.com/MeghanMHall/status/1560411406935138305
library(tidyverse)
library(ggrepel)
library(scales)
df1 <- txhousing %>%
filter(city %in% c("Houston","Austin")) %>%
group_by(year, city) %>%
summarize(avg = mean(median, na.rm = TRUE)) %>%