Skip to content

Instantly share code, notes, and snippets.

View manshu's full-sized avatar
🎧
Focusing

Himanshu Batra manshu

🎧
Focusing
View GitHub Profile
module.exports = {
apps: [
{
name: 'demo',
script: './start.js',
env: {
HOST: 'localhost',
PORT: 3000
}
}
// First, we need a js script to link in the ecosystem file,
// This is the script that will run our `npm start` command.
const exec = require("child_process").exec; // Or es6 modules, you know, I'm not your supervisor.
console.log(
`Starting app for production` // you may have different envs...
);
// Here's the good part
@manshu
manshu / US_States_and_Cities.json
Created December 3, 2019 20:23 — forked from ahmu83/US_States_and_Cities.json
List of US States and Cities in JSON format.
{
"New York": [
"New York",
"Buffalo",
"Rochester",
"Yonkers",
"Syracuse",
"Albany",
"New Rochelle",
"Mount Vernon",
CREATE TABLE `states` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@manshu
manshu / laravel-nearby-locations-query-scope.php
Created June 1, 2019 19:56 — forked from stevenmaguire/laravel-nearby-locations-query-scope.php
Laravel (Illuminate) query builder scope to list neighboring locations within a given distance from a given location
<?php
/**
* Query builder scope to list neighboring locations
* within a given distance from a given location
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param mixed $lat Lattitude of given location
* @param mixed $lng Longitude of given location
* @param integer $radius Optional distance
@manshu
manshu / command.sh
Created March 3, 2019 02:35 — forked from gangsthub/command.sh
PM2 start nuxt
# now run in your console: (I'm actually using powershell)
pm2 start .\ecosystem.config.js
#Overtime i have collected some stupid tweaks, that gets me through quicker.
alias al="cat ~/.alias"
alias pa="php artisan"
alias pad="php artisan dusk"
alias pam="php artisan migrate"
alias pas="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
alias pf="p --filter"
alias cv="pa view:clear && pa config:clear && pa cache:clear"
@manshu
manshu / .alias
Created May 29, 2018 02:36
Aliases
alias al="cat ~/.alias"
alias pa="php artisan"
alias pad="php artisan dusk"
alias pam="php artisan migrate"
alias pas="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
alias pf="p --filter"
alias cv="pa view:clear && pa config:clear && pa cache:clear"
alias cl="clear"
@manshu
manshu / gist:fe095176588f2d35fa421216e23b9146
Created August 19, 2017 06:55 — forked from belsrc/gist:672b75d1f89a9a5c192c
Simple Vue.js filters that I usually need
/**
* Changes value to past tense.
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc.
* http://jsfiddle.net/bryan_k/0xczme2r/
*
* @param {String} value The value string.
*/
Vue.filter('past-tense', function(value) {
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing
var vowels = ['a', 'e', 'i', 'o', 'u'];
@manshu
manshu / List.md
Created August 8, 2017 05:40 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):