Skip to content

Instantly share code, notes, and snippets.

View foloinfo's full-sized avatar
🏖️
Happy coding

foloinfo foloinfo

🏖️
Happy coding
View GitHub Profile
@janko
janko / results
Last active December 14, 2022 09:15
MiniMagick vs libvips benchmark (generating a 500x500 thumbnail)
width, imagemagick, libvips
1000, 0.129, 0.045
1500, 0.190, 0.067
2000, 0.276, 0.054
2500, 0.380, 0.068
3000, 0.498, 0.085
@renexu
renexu / build_libvips.md
Created January 24, 2019 19:46
build latest libvips deb on ubuntu 18.04

These are the steps to build latest libvips (8.7.4) deb package on ubuntu 18.04

##1. install build scripts

# sudo apt install build-essential devscripts

##2. download vips source

@rybon
rybon / compressGraphqlDocument.js
Last active August 25, 2022 19:48
Remove unnecessary whitespace from a GraphQL query / mutation / subscription
const compressGraphqlDocument = graphqlDocument =>
graphqlDocument
.replace(/#.*\n/g, '')
.replace(/[\s|,]*\n+[\s|,]*/g, ' ')
.replace(/:\s/g, ':')
.replace(/,\s/g, ',')
.replace(/\)\s\{/g, '){')
.replace(/\}\s/g, '}')
.replace(/\{\s/g, '{')
.replace(/\s\}/g, '}')
@l-rutong
l-rutong / amazon-calc.js
Last active June 4, 2021 05:53 — forked from polamjag/amazon-calc.js
Amazon購入履歴のCSVエクスポート (2017 年バージョン)
// Amazon購入履歴のCSVエクスポート
//
// 使い方:
// 1. 全部コピーする (右上の Raw をクリックした先でやるのが楽)
// 2. Amazon の注文履歴ページ ( https://www.amazon.co.jp/gp/css/order-history/ ) を開く
// 3. F12 または 右クリ→要素の検証 とかで出てくる開発者ツールのコンソール (JavaScript REPL) にペースト
// 4. エンターで実行
// (Firefox はなんか allow pasting とタイプしろみたいなことを言われるので従う)
// 5. しばらく待つと、コンソールに合計金額が表示され、CSVが保存される
//
@thevtm
thevtm / workspace-switcher
Last active June 11, 2020 03:13
CLI workspace switcher for GNOME based on Based on Andy Balaam's workspace-switcher
#!/bin/bash
# Workspace switcher for GNOME
# Author: thevtm@github
#
# Based on Andy Balaam's workspace-switcher
# http://www.artificialworlds.net/blog/2011/03/04/switching-workspace-in-gnome-via-the-command-line/
#
# REQUIREMENTS:
# * wmctrl
#

Bookmarklet to Post to Slack


Please note that this has a little problem: It posts the links as Slack Bot and not as yourself. You could add your name to the message but doesn't look right.


I've created a little bookmarklet that posts the url of the current webpage to a Slack channel. You have to set your token and the channel name manually but it's all fun and profit from there.

@amolkhanorkar
amolkhanorkar / PG::Error: ERROR: new encoding (UTF8) is incompatible
Last active November 29, 2023 17:57
Postgres PG::Error: ERROR: new encoding (UTF8) is incompatible
======= Prolbem =================================================================================================================
I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute:
rake db:create , command I get:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "my_db_name" ENCODING = 'unicode'.......
bin/rake:16:in `load'
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 2, 2024 12:33
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@masawada
masawada / mac-dev-env.md
Last active February 2, 2021 14:09
Macで最低限の開発環境整えるメモ

Macで最低限の開発環境整えるメモ

Yosemite向けでござる。

Command Line Toolsのインストール

$ xcode-select --install
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "VPC knowhow template",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern": "[-_ a-zA-Z0-9]*",