Skip to content

Instantly share code, notes, and snippets.

View pirj's full-sized avatar
🚜
Relentless

Phil Pirozhkov pirj

🚜
Relentless
View GitHub Profile
top10Salaries :: FilePath -> IO ()
top10Salaries path = do
Just (h, t) <- uncons . T.lines <$> T.readFile path
let
split = T.splitOn ","
Just ind = elemIndex "Salary" $ split h
top10 :: [Int] = t
& map (\s -> read $ T.unpack $ split s !! ind)
& sortBy (flip compare)
& take 10
@luisabarca
luisabarca / gist:760bd0d53623ec99ffec2c74d1e86921
Created April 2, 2018 20:15
Regexp for valid instagram username
# Regex by Jonathan Stassen. http://blog.jstassen.com/2016/03/code-regex-for-instagram-username-and-hashtags
/(?:@)([A-Za-z0-9_](?:(?:[A-Za-z0-9_]|(?:\.(?!\.))){0,28}(?:[A-Za-z0-9_]))?)/g
@mdPlusPlus
mdPlusPlus / compile_newest_stable_kernel_with_acso_patch.sh
Last active March 22, 2023 12:19
Download, patch, compile and install the newest stable Linux kernel with the ACS override patch (Ubuntu / Debian)
#!/bin/bash
function install_dependencies() {
echo "Installing dependencies..."
sudo apt -qq update
sudo apt -qq install -y curl git wget
# sudo apt -qq install -y bison flex kernel-package libelf-dev libssl-dev
sudo apt -qq install -y bison flex libelf-dev libssl-dev
}
@mturquette
mturquette / .offlineimaprc
Created January 18, 2016 06:29
OfflineIMAP nametrans and folderfilter example
[Repository local-baylibre]
...
nametrans = lambda folder: {
'drafts': '[Gmail]/Drafts',
'flagged': '[Gmail]/Starred',
'important': '[Gmail]/Important',
'inbox': 'INBOX',
'spam': '[Gmail]/Spam',
'trash': '[Gmail]/Trash',
}.get(folder, folder)
@hubertgrzeskowiak
hubertgrzeskowiak / NodeJS D3 with JSDOM
Last active November 12, 2023 17:37
Using d3.js (aka Data-Driven Documents) without browser with help of jsdom. This allows for server-side rendering or programmatic use in any other contexts than browser.
d3 = require("d3");
jsdom = require("jsdom");
document = jsdom.jsdom();
window = document.parentWindow;
var sampleSVG = d3.select(document.body)
.append("svg")
.attr("width", 100)
.attr("height", 100)
@estum
estum / switch_on.rb
Last active August 8, 2023 05:52
Ruby alternative switch-case syntax.
# = Kernel#switch
# Provides alternative switch-case syntax.
#
# # support methods:
# value = []
# switch value do
# on empty?: -> { "none" }
# on one?: -> { "one" }
# on many?: -> { "many" }
# end
@gcarrion-gfrmedia
gcarrion-gfrmedia / 0000_packages.config
Created April 29, 2014 10:49
AWS Elastic Beanstalk Ruby 2.0/Puma Environment - .ebextensions tweaks and Sidekiq configuration. This is known to work fine with AWS Elastic Beanstalk 's 64bit Amazon Linux 2014.03 v1.0.1 running Ruby 2.0 (Puma) stack. Later stack versions might not work, but for that specific version works fine.
# Install Git needed for Git based gems
packages:
yum:
git: []
@swarminglogic
swarminglogic / watchfile.sh
Last active March 4, 2024 14:44
watchfile - monitor file(s) and execute a command when files are changed
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@vrybas
vrybas / how-do-i-pomodoro.md
Last active March 12, 2019 11:08
Vladimir Rybas - How do I Pomodoro

vrybas.github.io

How do I Pomodoro

I'm a big fan of Pomodoro time management technique, created by Francesco Cirillo in the 80's. In this post I'll describe what it is, how I use it (tools and their tweaks), and how it helps me to get through my day.

Interruptions