Skip to content

Instantly share code, notes, and snippets.

View aviaryan's full-sized avatar
:electron:
Working

Avi Aryan aviaryan

:electron:
Working
View GitHub Profile
@aviaryan
aviaryan / REPO TOC GENERATOR.md
Last active July 12, 2017 14:02
Script to generate a TOC given we have md files in the repo

Just run this script from the root of the repo. It goes through all folders, gets all the files and creates a TOC for them.

python script.py

This will show you the TOC generated.

python script.py > out.txt
@aviaryan
aviaryan / es6_without_xpack.md
Created June 21, 2017 13:40
Run ElasticSearch 6 without Xpack
docker run -tid --name appbase_elasticsearch -e ES_JAVA_OPTS='-Xms750m -Xmx750m' -e "xpack.security.enabled=false" \
    -e "xpack.graph.enabled=false" -e "xpack.ml.enabled=false" -e "xpack.monitoring.enabled=false" \
    -e "xpack.watcher.enabled=false" -p 9200:9200 docker.elastic.co/elasticsearch/elasticsearch:6.0.0-alpha2
@aviaryan
aviaryan / GoSublime.sublime-settings
Created April 22, 2017 20:29
GoSublime User Settings
{
"env": {
"GOPATH": "$HOME/go",
"PATH": "$GOPATH/bin:$PATH"
},
// "fmt_cmd": ["goimports"],
// enable comp-lint, this will effectively disable the live linter
"comp_lint_enabled": true,

LaTTe Demo

Hello World

:help
:reset
a = 2

Keybase proof

I hereby claim:

  • I am aviaryan on github.
  • I am aviaryan (https://keybase.io/aviaryan) on keybase.
  • I have a public key whose fingerprint is C0B8 BB4F 85D7 E05E DC75 239E A9C6 A03E AF6B 353F

To claim this, I am signing this object:

Setup remote git repo on EC2

Create a bare repository

$ mkdir <repo-name>.git
$ cd <repo-name>.git
$ git init --bare
@aviaryan
aviaryan / gist:341850c432621ed1713d762f8949c791
Created December 21, 2016 16:17 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
#!/bin/bash
# python -m unittest tests.test_export_calendar
export DATABASE_URL=postgresql://open_event_user:start@127.0.0.1:5432/test
export SERVER_NAME=localhost:5000
export APP_CONFIG=config.DevelopmentConfig
if service --status-all | grep -e '\+.*postgresql'; then
echo postgresql exists
else
sudo service postgresql restart
@aviaryan
aviaryan / request_context_task_celery_flask.py
Created July 14, 2016 18:07
request context task celery flask
"""
Celery task wrapper to set request context vars and global
vars when a task is executed
Based on http://xion.io/post/code/celery-include-flask-request-context.html
"""
from celery import Task
from flask import has_request_context, make_response, request, g
from app import app # the flask app
import requests
import json
url = "https://api.github.com/markdown"
payload = {
"text": "**Hello** world !",
"mode": "gfm",
"context": "aviaryan/Clipjump"
}
r = requests.post(url = url, data = payload)