Skip to content

Instantly share code, notes, and snippets.

View suryakencana007's full-sized avatar
🛴
Never End Learning

Nanang Suryadi suryakencana007

🛴
Never End Learning
View GitHub Profile
class Book:
title = ''
pages = 0
def __init__(self, title='', pages=0):
self.title = title
self.pages = pages
def __add__(self, other):
"""Control adding two Books together or a Book and a number"""
@suryakencana007
suryakencana007 / osx-10.11-setup.md
Created December 13, 2015 09:35 — forked from kevinelliott/osx-10.11-setup.md
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

@suryakencana007
suryakencana007 / gist:866de1825625ef1b9c6c
Created February 20, 2016 04:25 — forked from inklesspen/gist:4222841
ACLs, context objects, and URL Dispatch in Pyramid
# A worked example based on http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/urldispatch.html#using-pyramid-security-with-url-dispatch
# in your configuration section (typically in myapp/__init__.py)
config.add_route('articles.edit', 'article/{id}/edit', factory='myapp.acl.ArticleACL')
# in myapp/acl.py
class ArticleACL(object):
def __init__(self, request):
# First, we assume this ACL object is used only in routes that provide an article id; if need be, you can add some sanity checking here, or some if/else branching
@suryakencana007
suryakencana007 / nginx.conf
Created May 29, 2016 21:21 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@suryakencana007
suryakencana007 / main.py
Created January 7, 2017 08:39
call for INI file at testing
from pyramid.paster import get_appsettings
settings = get_appsettings('test.ini', name='main')
app = main(settings)
@suryakencana007
suryakencana007 / gist:3c8b57e7c6ffdb15875c64fdf5149632
Created March 31, 2017 08:04 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@suryakencana007
suryakencana007 / CONTRIBUTING.md
Last active August 3, 2017 04:03
CONTIBUTE GUIDELINES

Contributing Guidelines

Some basic conventions for contributing to this project.

General

Please make sure that there aren't existing pull requests attempting to address the issue mentioned. Likewise, please check for issues related to update, as someone else may be working on the issue in a branch or fork.

  • Non-trivial changes should be discussed in an issue first
  • Develop in a topic branch, not master
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Profiled execution.
# Configure eslint prettier flow React
https://hackernoon.com/configure-eslint-prettier-and-flow-in-vs-code-for-react-development-c9d95db07213
#Fvk-ink Java (Don't ever install 9)
http://www.jenv.be/
# Onesignal-example
https://medium.com/differential/react-native-push-notifications-with-onesignal-9db6a7d75e1e
@suryakencana007
suryakencana007 / .bashrc
Created October 3, 2017 17:54 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin