Skip to content

Instantly share code, notes, and snippets.

View nonbeing's full-sized avatar
💭
Busy: may be slow to respond.

Ambar nonbeing

💭
Busy: may be slow to respond.
View GitHub Profile
@nonbeing
nonbeing / build.gradle (inside android-app)
Last active September 11, 2019 12:51
FlutterFire dependency versions working as of 11 Sep 2019
// NOTE: this is the build.gradle file located inside project/android/app
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
@nonbeing
nonbeing / schema.json
Created December 21, 2018 11:57
bigquery table's JSON schema definition
[
{
"type": "INTEGER",
"mode": "REQUIRED",
"name": "event_id"
},
{
"type": "STRING",
"mode": "REQUIRED",
@nonbeing
nonbeing / test.py
Created September 12, 2018 13:49 — forked from r39132/test.py
Writing Avro Without A Schema in Python
import avro.schema
import io, random
from avro.io import DatumWriter, DatumReader
import avro.io
# Path to user.avsc avro schema
schema_path="user.avsc"
schema = avro.schema.parse(open(schema_path).read())
@nonbeing
nonbeing / nginx.conf
Created August 10, 2018 21:06 — forked from leg0ffant/nginx.conf
Nginx file configuration Wordpress full SSL HSTS
#read more here http://tautt.com/best-nginx-configuration-for-security/
#don't send the nginx version number in error pages and Server header
server_tokens off;
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
@nonbeing
nonbeing / letsencrypt-wordpress-setup.md
Created August 6, 2018 19:45 — forked from harryfinn/letsencrypt-wordpress-setup.md
Instructions on how to setup a Letsencrypt SSL certificate on a WordPress site

Letsencrypt (for WordPress sites)

Note: This setup assumes you are running Ubuntu 16.04 OS with Apache 2.4.23, older versions of Ubuntu (i.e. 14.04) require minor configuration changes in order for this setup to work.

Setup

Follow the install instructions for certbot (letsencrypt's SSL manager) on https://certbot.eff.org/, making sure to select the correct server OS version.

Note: You only need to complete the Install section, then return to this README in order to setup your SSL

@nonbeing
nonbeing / agent-booking.json
Created October 17, 2017 12:31
agent booking sample json
{
"_id": 200325283,
"clientInterface": "mobile-iOS",
"totalFareWithCurrency": {
"amount": 1628000,
"currency": "IDR"
},
"totalSeatSelectionFareWithCurrency": {
"amount": 0,
"currency": "IDR"
@nonbeing
nonbeing / Spark+ipython_on_MacOS.md
Created April 22, 2017 12:20 — forked from ololobus/Spark+ipython_on_MacOS.md
Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112

For older versions of Spark and ipython, please, see also previous version of text.

Install Java Development Kit

@nonbeing
nonbeing / git-deployment.md
Last active April 1, 2025 16:55 — forked from noelboss/git-deployment.md
Simple deployment using git's post-receive hook

Also see: https://gist.github.com/lemiorhan/8912188

Simple automated deployment using git hooks

Here are the simple steps needed to push your local git repository directly to a remote (e.g. prod) server over ssh. This is based on Digital Ocean's Tutorial.

Overview

You are developing in a working-directory on your local machine, let's say on the master branch. Usually people push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use GitHub's webhooks to send a POST request to a webserver to take appropriate actions such as cloning/checking out a branch on the remote (prod) server.

@nonbeing
nonbeing / yaml2dir.py
Created January 31, 2017 15:39 — forked from blaketmiller/yaml2dir.py
represent YAML as a directory
#!/usr/bin/env python
import os
import sys
import yaml
def dict_to_dir(data, path=str()):
"""dict_to_dir expects data to be a dictionary with one top-level key."""
@nonbeing
nonbeing / dir2yaml.py
Created January 31, 2017 15:37 — forked from blaketmiller/dir2yaml.py
represent a directory tree in YAML
#!/usr/bin/env python
import os
import sys
import yaml
def dir_to_dict(path):
directory = {}