Skip to content

Instantly share code, notes, and snippets.

View manisnesan's full-sized avatar
🎯
Focusing

Manikandan Sivanesan` manisnesan

🎯
Focusing
View GitHub Profile
@manisnesan
manisnesan / gist:324f3f55f9f781d83c5d6ea63489595b
Created January 18, 2021 15:09 — forked from xcodeit/gist:3726868
General principles for good URI design
General principles for good URI design:
Don't use query parameters to alter state
Don't use mixed-case paths if you can help it; lowercase is best
Don't use implementation-specific extensions in your URIs (.php, .py, .pl, etc.)
Don't fall into RPC with your URIs
Do limit your URI space as much as possible
Do keep path segments short
Do prefer either /resource or /resource/; create 301 redirects from the one you don't use
Do use query parameters for sub-selection of a resource; i.e. pagination, search queries
#!/usr/bin/env bash
set -e
cd
case "$OSTYPE" in
darwin*) DOWNLOAD=https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh ;;
linux*) DOWNLOAD=https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh ;;
*) echo "unknown: $OSTYPE" ;;
esac
@manisnesan
manisnesan / delete_git_submodule.md
Created August 25, 2020 15:25 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@manisnesan
manisnesan / openshift-cheatsheet.md
Last active September 1, 2020 02:04 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Openshift build secrets for cloning git repos using SSH Keys

  • To create ssh secret:
oc create secret generic sshsecret \
    --from-file=ssh-privatekey=$HOME/.ssh/id_rsa
@manisnesan
manisnesan / Bag of Tricks for Efficient Text Classification.md
Created July 6, 2019 16:49 — forked from shagunsodhani/Bag of Tricks for Efficient Text Classification.md
Summary of "Bag of Tricks for Efficient Text Classification" paper

Bag of Tricks for Efficient Text Classification

Introduction

  • Introduces fastText, a simple and highly efficient approach for text classification.
  • At par with deep learning models in terms of accuracy though an order of magnitude faster in performance.
  • Link to the paper
  • Link to code

Architecture

JQ to filter by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

jq -c '. | select(.action == "problem_statement") | select(.context[] | contains("ipsum") | not) | .context[] | select(split(" ") | length &lt; 20)' session_july_last_few_days.jsonl
@manisnesan
manisnesan / Delete by Query - SOLR
Created February 20, 2019 14:00 — forked from abdollar/Delete by Query - SOLR
Delete by Query to delete from SOLR
delete from solr - delete by query
curl http://hostname:port/solr/update --data-binary '<delete><query>id:123456</query></delete>' -H 'Content-type:text/xml; charset=utf-8'
curl http://hostname:port/solr/update --data-binary '<commit waitFlush="false" waitSearcher="false" expungeDeletes="true"/>' -H 'Content-type:text/xml; charset=utf-8'
@manisnesan
manisnesan / nltk-intro.py
Created February 19, 2016 20:28 — forked from alexbowe/nltk-intro.py
Demonstration of extracting key phrases with NLTK in Python
import nltk
text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital
computer or the gears of a cycle transmission as he does at the top of a mountain
or in the petals of a flower. To think otherwise is to demean the Buddha...which is
to demean oneself."""
# Used when tokenizing words
sentence_re = r'''(?x) # set flag to allow verbose regexps
([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A.
@manisnesan
manisnesan / DefaultJenkinsEmail
Created October 7, 2015 14:10 — forked from ferventcoder/DefaultJenkinsEmail
Jenkins Email-ext (Editable Email Notifications)
Subject: Jenkins ${BUILD_STATUS} [#${BUILD_NUMBER}] - ${PROJECT_NAME}
Content Type: Plain Text (text/plain)
Trigger for matrix projects: Trigger for each configuration
Choose "Advanced", "Add a Trigger" and choose the following triggers:
Fixed, Failure, Unstable, Still Failing, Still Unstable
Ensure that "Send To Recipient List" is checked for all of these at the very least.
Fixed is the only trigger you will need to expand to change the Content.
@manisnesan
manisnesan / Vagrantfile
Created September 30, 2015 15:29 — forked from nruth/Vagrantfile
vagrant ubuntu 14.04 rbenv mysql for rails
Vagrant.configure(2) do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = 'ubuntu/trusty64'
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
config.vm.network "forwarded_port", guest: 3000, host: 3000