Skip to content

Instantly share code, notes, and snippets.

View zobzn's full-sized avatar

Semyon Tokarev zobzn

View GitHub Profile
@zobzn
zobzn / index.php
Last active August 29, 2015 14:27 — forked from ziadoz/index.php
Simple PHP HTTP Handling
<?php
// See Error Handling in PHP: https://nomadphp.com/2015/02/25/nomadphp-2015-02-us-lt2/#
$display = function ($status, $headers = array(), $content = '') {
http_response_code($status);
foreach ($headers as $key => $value) {
header($key . ': ' . $value);
}
@zobzn
zobzn / gmap.php
Last active August 29, 2015 14:27 — forked from ziadoz/gmap.php
Generating a Static Google Map with PHP
<?php
$url = 'http://maps.googleapis.com/maps/api/staticmap?';
$bits = array(
'center' => 'Calgary Tower, Calgary, AB, Canada',
'zoom' => '16',
'size' => '800x600',
'maptype' => 'roadmap',
'markers' => 'color:0x576d4e|label:N|49.6967179,-112.8450119',
'sensor' => 'false',
);
@zobzn
zobzn / firebase.json
Last active April 27, 2021 21:49 — forked from mizchi/firebase.json
Cloud Function built by webpack
{
"functions": {
"source": "functions"
},
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "/api/hello",
@zobzn
zobzn / nginx_auto_start.sh
Created May 1, 2022 18:36 — forked from aymanosman/nginx_auto_start.sh
Nginx: Start nginx on boot on Mac
# brew install nginx
sudo ln -s /usr/local/opt/nginx/homebrew.mxcl.nginx.plist /Library/LaunchDaemons/
sudo chown root:wheel /usr/local/opt/nginx/homebrew.mxcl.nginx.plist
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
# Why do you need sudo?
# If you want nginx to be able to bind to port 80, it will need superuser privileges