Skip to content

Instantly share code, notes, and snippets.

View purnimagupta's full-sized avatar
🏠
Working from home

Purnima purnimagupta

🏠
Working from home
View GitHub Profile
#create a test index with shingle mapping
curl -XPUT localhost:9200/test -d '{
"settings":{
"index":{
"analysis":{
"analyzer":{
"analyzer_shingle":{
"tokenizer":"standard",
"filter":["standard", "lowercase", "filter_stop", "filter_shingle"]
}
@purnimagupta
purnimagupta / Auth.js
Created July 16, 2021 12:49 — forked from imCorfitz/Auth.js
Strapi Refresh Token
// extensions/users-permissions/controllers/Auth.js
"use strict";
/**
* Auth.js controller
*
* @description: A set of functions called "actions" for managing `Auth`.
*/
/* eslint-disable no-useless-escape */
@purnimagupta
purnimagupta / postgresql_configuration_on_ubuntu_for_rails.md
Created August 7, 2018 11:16 — forked from p1nox/postgresql_configuration_on_ubuntu_for_rails.md
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@purnimagupta
purnimagupta / 0-startup-overview.md
Created March 15, 2017 14:22 — forked from dideler/0-startup-overview.md
Startup Engineering notes
@purnimagupta
purnimagupta / node-and-npm-in-30-seconds.sh
Last active August 29, 2015 14:26 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
// http://svn.webkit.org/repository/webkit/trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
// "Min" sort. Not the fastest, but definitely less code than heapsort
// or quicksort, and much less swapping than bubblesort/insertionsort.
for (unsigned i = 0; i < length - 1; ++i) {
JSValue iObj = thisObj->get(exec, i);
if (exec->hadException())
return JSValue::encode(jsUndefined());
unsigned themin = i;
JSValue minObj = iObj;