Skip to content

Instantly share code, notes, and snippets.

@brad-anton
brad-anton / requests_connect_over_https.py
Last active June 3, 2024 16:16
This is a creative way to force python requests' module to issue a Proxy CONNECT over HTTPS. Also allows you to define proxy headers and other goodies
"""
requests_connect_over_https.py
@brad_anton
This is a creative way to force python requests' module to issue a Proxy
CONNECT over HTTPS. Also allows you to define proxy headers and other goodies
Warning: This was only tested partially
"""
@vcavallo
vcavallo / notes.md
Last active August 25, 2020 09:01
rails + webpacker + webpack-dev-server + vue + remote dev vps and nginx

Process goes something like this:

bundle update webpacker
rails webpacker:binstubs
yarn upgrade @rails/webpacker@4.0.0-pre.2 # or 'add' instead of upgrade
yarn upgrade webpack-dev-server@"'3.1.4'  # or 'add' instead of upgrade
yarn add webpack-cli

bundle exec rails webpacker:install # don't do this! the scrpit seems to overwrite the @rails/webpacker version to 3.5.3
@kgjenkins
kgjenkins / readme.md
Last active February 12, 2023 13:29
Labels with callout lines in QGIS

Labels with callout lines in QGIS


UPDATE: As of October 2019, QGIS 3.10 has built-in support for label callout lines!


Callouts, sometimes called leader lines, are lines between labels and features on a map. They are useful when constraints of space force a label to be moved away from the

@bbonamin
bbonamin / Brewfile
Last active July 22, 2024 21:29
Capybara Selenium Webdriver: Headless Chrome (with file downloads!) & Headless Firefox
tap "caskroom/cask"
cask "google-chrome"
cask "firefox"
brew "chromedriver"
brew "geckodriver"
@chunter
chunter / pageant-autoload-keys-at-startup.txt
Created June 20, 2017 10:51
Make Pageant autoload keys at startup
To make Pageant automatically run and load keys at startup:
- Find the location of pageant.exe
- Windows key + R to open the 'run' dialog box
- Type: 'shell:startup' in the dialog box
- Create a shortcut to the pageant.exe and put into this startup folder.
@luckydev
luckydev / gist:b2a6ebe793aeacf50ff15331fb3b519d
Last active October 22, 2022 14:03
Increate max no of open files limit in Ubuntu 16.04/18.04 for Nginx
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf
@4rzael
4rzael / main.md
Last active April 25, 2024 04:41
GIS with pySpark.
NOTE : Take a look at the comments below !

GIS with pySpark : A not-so-easy journey

Why would you do that ?

Today, many datas are geolocalised (meaning that they have a position in space). They're named GIS datas.

It's not rare that we need to do operations on those, such as aggregations, and there are many optimisations existing to do that.

function long2tile(lon,zoom) {
return (((lon+180)/360*Math.pow(2,zoom)));
}
function lat2tile(lat,zoom) {
return (((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom)));
}
function tile2long(x,z) {
return (x/Math.pow(2,z)*360-180);
}
function tile2lat(y,z) {
@eritiro
eritiro / Gemfile
Created August 25, 2015 12:37
Working Gemfile for rails 5 app (alpha version)
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '5.0.0.alpha', git: "https://github.com/rails/rails"
gem 'rack', '~> 2.x', git: "https://github.com/rack/rack"
gem 'arel', git: "https://github.com/rails/arel"
gem 'rack-test', git: 'https://github.com/brynary/rack-test'
gem 'sprockets', github: 'rails/sprockets', branch: 'master'
@ju2wheels
ju2wheels / docker-compose.yml
Created June 10, 2015 20:11
docker-compose reference YAML file with comments
# https://docs.docker.com/compose/yml/
# Each service defined in docker-compose.yml must specify exactly one of
# image or build. Other keys are optional, and are analogous to their
# docker run command-line counterparts.
#
# As with docker run, options specified in the Dockerfile (e.g., CMD,
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to
# specify them again in docker-compose.yml.
#
service_name: