Skip to content

Instantly share code, notes, and snippets.

@nadar
nadar / PostMessageToSlackChannel.php
Last active May 3, 2024 10:40
Post a message to a slack channel with PHP
<?php
/**
* Send a Message to a Slack Channel.
*
* In order to get the API Token visit:
*
* 1.) Create an APP -> https://api.slack.com/apps/
* 2.) See menu entry "Install App"
* 3.) Use the "Bot User OAuth Token"
@arthur-e
arthur-e / notes.md
Last active March 2, 2022 07:19
Ubuntu for GIS Installation and Setup

Post-Installation Fixes and Setup

# Install compilers and linking tools; other tools
sudo apt-get install g++ swig curl build-essential python-all-dev

# Install package manager
sudo apt-get install synaptic

# Install Unity customization tool

sudo apt-get install unity-tweak-tool

@Globegitter
Globegitter / nginx-latest.sh
Last active May 7, 2022 18:19
Install the latest nginx from source for Ubuntu 14.04
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active December 1, 2023 04:55
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@beshur
beshur / route.js
Last active August 21, 2019 04:02 — forked from cultofmetatron/gist:5349630
Javascript Node.js Express Login route with ajax responses
app.post('/login', function(req, res) {
console.log(res);
passport.authenticate('local', function(err, user, params) {
if (req.xhr) {
//thanks @jkevinburton
if (err) { return res.json({ error: err.message }); }
// e.g. in auth.js:
// if (!user.emailVerified) { return done(null, false, { message: 'Email is not verified. Please check your email for the link.' }); }
if (!user && params) { return res.json({error : params.error}); }
@robinkraft
robinkraft / osgeo_compile.sh
Created June 24, 2014 01:41
compile and install GEOS, PROJ4 and GDAL from source on Ubuntu 12.0.4
# Compile/install GEOS. Taken from:
# http://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu#GEOS_2
cd /tmp
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
bunzip2 geos-3.4.2.tar.bz2
tar xvf geos-3.4.2.tar
cd geos-3.4.2
@samuraee
samuraee / application.php
Last active November 27, 2019 09:10
Environment based configuration for PhalconPHP (Production/Development/Staging)
<?php
// your main aplication config file
// app/config/application.php
$config = [
'application' => [
'cacheDir' => __DIR__ . '/../../cache/',
'appDir' => __DIR__ . '/../',
'baseUri' => '/',
'basePath' => '/',
'publicUrl' => 'http://www.your_domain.com',
@mbostock
mbostock / .block
Last active December 31, 2019 23:07
Processing Fixed-Width Data
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/parsing-fixed-width-data
#!/bin/bash
echo "This script will rebuild a Debian style package (deb) of latest stable"
echo "Nginx. The original deb is from nginx.org apt repository."
echo
echo "This will prompt you yes or no on a few changes to the build as well as"
echo "it will compile and package the latest Google NGX Pagespeed module."
echo
echo "This is built and tested on Ubuntu 12.04 LTS, fresh OS install."
echo "There are no guarantees, and I take no liability if it breaks, but it"
@rclark
rclark / Issues.md
Last active January 28, 2024 01:18
Leaflet WMS + GetFeatureInfo

There are a bunch of reasons why this is convoluted, mostly in building the URL to make the request:

  1. You have to rely on an AJAX request, this example uses jQuery
  2. To make a GetFeatureInfo request, you must provide a BBOX for a image, and the pixel coordinates for the part of the image that you want info from. A couple of squirrely lines of Leaflet code can give you that.
  3. Output formats. The info_format parameter in the request. We don't know a priori which will be supported by a WMS that we might make a request to. See Geoserver's docs for what formats are available from Geoserver. That won't be the same from WMS to WMS, however.
  4. WMS services return XML docs when there's a mistake in the request or in processing. This sends an HTTP 200, which jQuery doesn't think is an error.