Skip to content

Instantly share code, notes, and snippets.

@anndream
anndream / url_slug.js
Created January 3, 2018 07:17 — forked from sgmurphy/url_slug.js
URL Slugs in Javascript (with UTF-8 and Transliteration Support)
/**
* Create a web friendly URL slug from a string.
*
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
@anndream
anndream / next_nginx.md
Created January 1, 2018 04:54 — forked from kocisov/next_nginx.md
How to setup next.js app on nginx with letsencrypt

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@anndream
anndream / Readme.md
Created October 7, 2015 07:43 — forked from pdvyas/Readme.md
Sales Invoice REST API example

This example uses curl. You can use any other means of making http requests. Responses are in JSON format.

  • Login to frappe (and store cookies in a jar)
% curl https://demo.frappecloud.com/api/method/login -XPOST \-d "usr=demo%40frappecloud.com&pwd=demo" -c frappe.cookie   
{"message":"Logged In","full_name":"Demo User"}
  • Request for a Sales Invoice by id (output is piped to json pretty printer(optional))
# Run as your work user
# Make sure you are not using root
# Disable sudo timeout
sudo sh -c 'echo "\nDefaults timestamp_timeout=-1">>/etc/sudoers'
# Projects root directory
ODOO_PROJECTS_DIR="projects"
# Odoo version
ODOO_VERSION="8.0"
@anndream
anndream / gist:3614e3ce2091fcbf5727
Last active September 2, 2015 03:31 — forked from komuw/gist:b98d1b0bdeb6940cc41a
monit-odoo/openerp conf file
set daemon 600 #in seconds
set logfile /home/webapp/log/monit.log
check process rabbit with pidfile /var/run/odoo.pid
start program = "/etc/init.d/odoo start"
stop program = "/etc/init.d/odoo stop"
@anndream
anndream / codeigniter-apache-hhvm.md
Last active August 26, 2015 06:51 — forked from shivaas/codeigniter-apache-hhvm.md
CodeIgniter with Apache & HHVM as FastCGI

Apache Configuration:

<VirtualHost *:80>
  ServerName blah.com

  DirectoryIndex index.html index.php
  ProxyRequests On
  ProxyPreserveHost On
  ProxyVia full