Skip to content

Instantly share code, notes, and snippets.

View micheleriva's full-sized avatar
🍄
Building Orama

Michele Riva micheleriva

🍄
Building Orama
View GitHub Profile
@pkese
pkese / fizzbuzz.fs
Last active February 1, 2021 10:45
let (|IsMultiple|_|) n x = if x % n = 0 then Some n else None
[1..100]
|> List.map (function
| IsMultiple 15 x -> "FizzBuzz"
| IsMultiple 5 x -> "Buzz"
| IsMultiple 3 x -> "Fizz"
| x -> $"{x}")
|> List.iter (printfn "%s")
@DarthSim
DarthSim / 00.imgproxy_vs_alternatives.md
Last active June 26, 2024 11:05
imgproxy vs alternatives benchmark

imgproxy vs alternatives benchmark

Setup

  • c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
  • Ubuntu 18.04
  • Go 1.12
  • Python 2.7
  • Vips 8.7.4
@equinusocio
equinusocio / .gitconfig
Created March 29, 2019 11:57
My global git config and aliases
[user]
name = Mattia Astorino
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
[color "status"]
@chrismccord
chrismccord / phx-1.4-upgrade.md
Last active June 16, 2023 06:22
Phoenix 1.3.x to 1.4.0 Upgrade Guides

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Install the new phx.new project generator

The mix phx.new archive can now be installed via hex, for a simpler, versioned installation experience.

To grab the new archive, simply run:

@Bonno
Bonno / README.md
Last active August 11, 2023 14:13
Opening multiple SSH sessions with iTerm automatically. To be used in an Automator flow.

Create a new Automater flow

Add 'Service'. Service receives 'no input' in 'iTerm'. Add 'Run AppleScript'.

@ydnar
ydnar / redirects.js
Last active September 12, 2023 10:14
Nuxt.js middleware to enable redirects to absolute URLs
import url from 'url'
import qs from 'qs'
export default function (ctx) {
fixRedirect(ctx)
const { route, redirect } = ctx
const { path, query } = route
// Redirect trailing slashes, preserving query string: /foo/ -> /foo
if (path.length > 1 && path.slice(-1) === '/') {
@apisandipas
apisandipas / share-urls.md
Last active May 9, 2024 15:31 — forked from chrisjlee/drupal-views-share-global-text-field
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@j-min
j-min / test_multi_gpu.py
Last active January 15, 2022 01:57
TensorFlow multi GPU example
from __future__ import print_function
'''
Basic Multi GPU computation example using TensorFlow library.
Author: Aymeric Damien
Project: https://github.com/aymericdamien/TensorFlow-Examples/
'''
'''
This tutorial requires your machine to have 2 GPUs
"/cpu:0": The CPU of your machine.
@diegopacheco
diegopacheco / elasticsearch-es-delete-all-data.md
Created August 10, 2016 21:36
How to Delete All Data in Elasticsearch?
curl -XDELETE localhost:9200/*
@jaawerth
jaawerth / compose.es6.js
Last active October 17, 2020 08:08
ES5 and ES6 implementations of compose - readable implementation, not optimized
function compose(...fnArgs) {
const [first, ...funcs] = fnArgs.reverse();
return function(...args) {
return funcs.reduce((res, fn) => fn(res), first(...args));
};
}