Skip to content

Instantly share code, notes, and snippets.

View s-jcs's full-sized avatar

Sho Sundberg s-jcs

  • Japan
View GitHub Profile
@arccoder
arccoder / cyclic_intersection_pts.py
Last active July 4, 2023 14:57
Straighten a page using OpenCV
def cyclic_intersection_pts(pts):
"""
Sorts 4 points in clockwise direction with the first point been closest to 0,0
Assumption:
There are exactly 4 points in the input and
from a rectangle which is not very distorted
"""
if pts.shape[0] != 4:
return None
@kingtuna
kingtuna / openresty-ubuntu-install.sh
Last active July 24, 2020 01:07 — forked from alex-roman/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.11.2.1.tar.gz
tar zxvf openresty-1.11.2.1.tar.gz
cd openresty-1.11.2.1
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@koseki
koseki / too-many-markers.md
Last active June 8, 2021 05:35
Google Maps に大量のマーカを表示する

Google Maps に大量のマーカを表示する - Too Many Markers!

のメモです。

Introduction

Some applications are required to display a large number of locations or markers. Despite the v3 JavaScript API's significant improvement to performance, naively plotting thousands of markers on a map can quickly lead to a degraded user experience. Too many markers on the map cause both visual overload and sluggish interaction with the map.

@justinweiss
justinweiss / filterable.rb
Last active January 11, 2024 07:28
Filterable
# Call scopes directly from your URL params:
#
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with names based on the keys in <tt>filtering_params</tt>
# with their associated values. For example, "{ status: 'delayed' }" would call
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev