Skip to content

Instantly share code, notes, and snippets.

View mezbahalam's full-sized avatar
🏠

Mezbah Alam mezbahalam

🏠
View GitHub Profile
@mezbahalam
mezbahalam / user.rb
Last active May 14, 2018 09:49
rails strong password validator regex
validates :password,
length: { minimum: 10 },
format: { with: /\A(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[\W]).{10,}\z/,
message: "Must contain at least one uppercase letter, one special character, one number and one lowercase letter" }

Products

index of products 25 first

curl -i -H "X-Spree-Token: YOUR_TOKEN_ID" http://0.0.0.0:3000/api/products.json

Show a product

curl -i -H "X-Spree-Token: YOUR_TOKEN_ID" http://0.0.0.0:3000/api/products/706676762.json

Modify a product

curl -i -X PUT -H "X-Spree-Token: YOUR_TOKEN_ID" -d "product[name]=Headphones" http://0.0.0.0:3000/api/products/706676762.json

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Opacity Sample</title>
<style>
.gallery {display:none;}
</style>
<script>
function Gid(id) {