Skip to content

Instantly share code, notes, and snippets.

View manshu's full-sized avatar
🎧
Focusing

Himanshu Batra manshu

🎧
Focusing
View GitHub Profile
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_read_timeout 1m;
proxy_connect_timeout 1m;
proxy_pass http://127.0.0.1:3000; # set the address of the Node.js
}
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 / devel.md
Created June 18, 2016 18:34
Ruby on Rails Development Environment

Ruby on Rails Development Environment

Introduction

Forward

Sometimes we have to configure a new development machine, whether it is for ourselves or a friend. We often find that there are some little pieces of our environment that we have forgotten about or have neglected to document. This is my documentation for a ready-to-work development environment for Ruby on Rails.

About Me

name: Gurulabs.dev
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
{
"name": "gurulabs",
"version": "1.0.0",
"main": "index.js",
"repository": "git@github.com:manshu/shopify-gurulabs.git",
"author": "Himanshu Batra <himanshu@batra.io>",
"license": "MIT",
"scripts": {
"watch": "mix watch"
},
@manshu
manshu / package.json
Created November 22, 2020 02:15
NextJS with Typescript
{
"name": "myapp",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
<template>
<div>
<form @submit.prevent="onSubmit" class="mt-4 sm:flex sm:max-w-md">
<input
aria-label="Email address"
type="email"
name="email"
v-model="form.email"
required
class="appearance-none w-full px-5 py-3 border border-transparent text-base leading-6 rounded-md text-gray-900 bg-white placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 transition duration-150 ease-in-out"
@manshu
manshu / CRMServiceProvider
Last active July 13, 2020 15:23
Pipedrive CRMServiceProvider
class CRMServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
}
var stripe = Stripe(
document.head.querySelector('meta[name="stripeKey"]').content
);
var elements = stripe.elements();
var card = elements.create("card");
card.mount("#card");
card.addEventListener("change", function(event) {
var displayError = document.getElementById("cardErrors");
if (event.error) {
displayError.textContent = event.error.message;
@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