Skip to content

Instantly share code, notes, and snippets.

View simoncpu's full-sized avatar
👽

Simon Cornelius P. Umacob simoncpu

👽
  • Cebu City, Philippines
View GitHub Profile
@simoncpu
simoncpu / states_array.json
Last active February 26, 2018 17:19
US states with capitals in JSON form
[
{
"state": "Alabama",
"abbreviation": "AL",
"capital": "Montgomery"
},
{
"state": "Alaska",
"abbreviation": "AK",
"capital": "Juneau"
@simoncpu
simoncpu / states_longname_hash.json
Created February 26, 2018 16:02
US states in JSON form.
{
"Alabama": "AL",
"Alaska": "AK",
"American Samoa": "AS",
"Arizona": "AZ",
"Arkansas": "AR",
"California": "CA",
"Colorado": "CO",
"Connecticut": "CT",
"Delaware": "DE",
@simoncpu
simoncpu / states_hash.json
Created February 26, 2018 15:48 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
server
{
# To avoid changing your app config
# point Nginx to the Solr port
listen 8983;
# Set read/write variables
set $solr_write "0";
set $solr_read "1";
set $solr_admin "0";
@simoncpu
simoncpu / mod_fastcgi.c.patch
Created March 16, 2012 10:58
lighttpd patch for Bug #2333
--- mod_fastcgi.c.orig 2012-03-16 10:51:07.000000000 +0800
+++ mod_fastcgi.c 2012-03-16 10:42:16.000000000 +0800
@@ -1857,7 +1857,16 @@
if (con->server_name->used) {
size_t len = con->server_name->used - 1;
- char *colon = strchr(con->server_name->ptr, ':');
+ char *colon;
+#ifdef HAVE_IPV6
+ if (srv_sock->addr.plain.sa_family == AF_INET6) {
@simoncpu
simoncpu / mod_cgi.c.patch
Created March 16, 2012 10:56
lighttpd patch for Bug #2333
--- mod_cgi.c.orig 2012-03-16 10:50:53.000000000 +0800
+++ mod_cgi.c 2012-03-16 10:42:28.000000000 +0800
@@ -811,7 +811,16 @@
if (!buffer_is_empty(con->server_name)) {
size_t len = con->server_name->used - 1;
- char *colon = strchr(con->server_name->ptr, ':');
+ char *colon;
+#ifdef HAVE_IPV6
+ if (srv_sock->addr.plain.sa_family == AF_INET6) {
@simoncpu
simoncpu / gist:927088
Created April 19, 2011 10:11
support for AgaviWebRequest::getUrlPort() behind a proxy
--- AgaviWebRequest.class.php 2011-04-19 18:06:22.000000000 +0800
+++ AgaviWebRequest.class.php.orig 2011-04-19 17:30:15.000000000 +0800
@@ -327,7 +327,6 @@
'SERVER_PORT' => 'SERVER_PORT',
'SERVER_PROTOCOL' => 'SERVER_PROTOCOL',
'SERVER_SOFTWARE' => 'SERVER_SOFTWARE',
- 'HTTP_HOST' => 'HTTP_HOST',
), (array)$this->getParameter('sources'));
$this->setParameter('sources', $sources);
From a3d0d8e89dd0c091414df9aaa3ef03f64911e587 Mon Sep 17 00:00:00 2001
From: Simon Cornelius P. Umacob <[email protected]>
Date: Thu, 10 Dec 2009 20:18:29 +0800
Subject: [PATCH] Implement getmem() for FreeBSD platform.
---
src/node.cc | 32 ++++++++++++++++++++++++++++++++
wscript | 8 +++++---
2 files changed, 37 insertions(+), 3 deletions(-)
simoncpu@soulfury:~$ ab -c 50 -n 100000 http://127.0.0.1:8000/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests