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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Gurulabs.dev | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
test: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "myapp", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"scripts": { | |
"dev": "next", | |
"build": "next build", | |
"start": "next start" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CRMServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Register services. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
NewerOlder