Skip to content

Instantly share code, notes, and snippets.

View epinapala's full-sized avatar

Eswar Pinapala epinapala

View GitHub Profile
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Eswara Rajesh Pinapala",
"label": "Engineering & Tech Leadership",
"email": "[email protected]",
"phone": "(669) 308-0497",
"location": {
"city": "Fremont",
"region": "California",
@epinapala
epinapala / README.md
Created September 26, 2019 18:39 — forked from hofmannsven/README.md
Command Line Cheatsheet
@epinapala
epinapala / index.html
Created March 5, 2019 03:26
New pen based on hlsjs plugin
<h2 id="live">Live</h2>
<div id="hlsjslive" class="fp-slim"></div>
<div class="info">
<p>player engine: <span id="engine1"></span></p>
<p>video type: <span id="vtype1"></span></p>
<p id="detail1"> </p>
@epinapala
epinapala / mamp_php.sh
Created March 4, 2019 20:45
Use Mamp php in Mac
sudo ln -s /Applications/MAMP/bin/php/php7.1.20/bin/php /usr/local/bin/php
@epinapala
epinapala / example.js
Created May 31, 2018 16:38 — forked from ignlg/example.js
Fixes "TypeError: JSON.stringify cannot serialize cyclic structures" error when exporting to JSON a KeystoneJS model/list including virtuals.
var modelCleanCyclic = require('./modelCleanCyclic');
var Example = new keystone.List('Example', {});
Example.schema.set('toJSON', {
virtuals: true,
transform: modelCleanCyclic.transformer
});
@epinapala
epinapala / composer.bat
Created May 20, 2018 18:32 — forked from JCook21/composer.bat
Quick Batch file to add a 'composer' command to windows.
@echo off
if "%PHPBIN%" == "" set PHPBIN=C:\path\to\PHP\executable\dir\.\php.exe
"%PHPBIN%" "C:\path\to\composer.phar" %*
@epinapala
epinapala / ._readme
Created April 20, 2018 19:14 — forked from nikolowry/._readme
Customize Keystone
This GIST illustrates a hack to allow for configurable backend-url and admin styles in Keystone.js
New deps introduced:
- node-dir
- shelljs
New directory structure after running "yo keystone":
.
|____admin
| |____assets

#How does KeystoneJS render it's Admin UI

KeystoneJS is an open source framework for developing database-driven websites, applications and APIs in Node.js. It's built on Express and MongoDB.The easiest way to get started with KeystoneJS is to use Yeoman Generator.yo keystone will scaffold a new KeystoneJS project for you, and offer to set up blog, gallery, and enquiry (contact form) models + views.If you'd like to try the demo at first,here it is.

When I wrote this,keystone's stable version is 0.2.39,and 0.3.0 not published yet,so if you have a different version of KeystoneJS,the content maybe different.

##Generate a KeystoneJS Project

First up, you'll need Node.js >= 0.10.x and MongoDB >= 2.4.x installed. Then, install the Keystone generator:

@epinapala
epinapala / gist:f07f01643208ca90934550e08d1ff789
Created April 19, 2018 23:36 — forked from rturk/gist:f5ff8a16124365b8a113
Mongoose Virtual field async await
Schema.virtual('comments')
//Returns comment owned by this product
.get(
async obj => await Comment
.find({ 'owner': this._id, deleted: { $ne: true } })
.sort('-likesCount -date_modified')
.limit(6)
.exec()
);