Skip to content

Instantly share code, notes, and snippets.

@jeevan-vj
jeevan-vj / composing-software.md
Created October 12, 2019 17:59 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series
@jeevan-vj
jeevan-vj / StreamComparer.cs
Created December 19, 2018 03:40 — forked from sebingel/StreamEquals.cs
Compare two streams bit by bit in C#
private bool CompareStreams(Stream a, Stream b)
{
if (a == null &&
b == null)
return true;
if (a == null ||
b == null)
{
throw new ArgumentNullException(
a == null ? "a" : "b");
@jeevan-vj
jeevan-vj / woocommerce-update-prices.sql
Last active September 1, 2018 05:48 — forked from yanknudtskov/woocommerce-update-prices.sql
Queries for updating all prices including variations in WooCommerceIn this instance all prices are increased 2% #woocommerce #mysql
UPDATE wp_postmeta SET meta_value = Round(meta_value*1.02, 2) WHERE meta_key = '_regular_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = Round(meta_value*1.02, 2) WHERE meta_key = '_sale_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = Round(meta_value*1.02, 2)WHERE meta_key = '_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = Round(meta_value*1.02, 2) WHERE meta_key = '_regular_price_tmp' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = Round(meta_value*1.02, 2) WHERE meta_key = '_sale_price_tmp' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = Round(meta_value*1.02, 2) WHERE meta_key = '_price_tmp' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = Round(meta_value*1.02, 2) WHERE meta_key = '_min_variation_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = Round(meta_value*1.02, 2) WHERE meta_key = '_max_variation_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = Round(meta_value*1.02, 2) WHERE meta_key = '_min_va
@jeevan-vj
jeevan-vj / http-server.js
Created June 17, 2018 08:18 — forked from duluca/http-server.js
No plug-in http server for Node.js
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8080;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), "public", uri);
@jeevan-vj
jeevan-vj / StartingWithDocker.md
Created June 17, 2018 08:16 — forked from duluca/StartingWithDocker.md
Starting with Docker

What is Docker?

  • Docker is an open platform for developing, shipping, and running applications.
  • Combines a lightweight container virtualization platform with workflows and tooling that help manage and deploy applications.

Why is Containerization Important?

  • Containerization allows for encapsulation of app specific configuration concerns.
  • Encapsulation allows for decoupling of dependencies, so each app can depend on different versions.
  • Simpler dependency management results in a low friction IT environment, less things to learn and break.
  • Low friction allows to ship code faster, test faster, deploy faster, shortening the cycle between writing code and running code.

These are generic npm scripts that you can copy & paste into your package.json file as-is and get access to convinience scripts to manage your Docker images all in one place.

Looking for npm scripts for AWS ECS? Go here!

Watch the video: Do More With Less JavaScript

Docker Containers for Static or Angular/React/Vue/etc SPA Websites

@jeevan-vj
jeevan-vj / introrx.md
Created April 19, 2018 03:43 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@jeevan-vj
jeevan-vj / isBase64.js
Created February 20, 2018 08:14 — forked from RyanNutt/isBase64.js
Check if a String is base64 encoded using JavaScript - from https://stackoverflow.com/a/34068497/1561431
function isBase64(str) {
try {
return btoa(atob(str)) == str;
} catch (err) {
return false;
}
}
@jeevan-vj
jeevan-vj / deploy-static.ps1
Created December 3, 2017 14:39 — forked from chardcastle/deploy-static.ps1
Upload files (recursive) via powershell
## Automate FTP uploads
## Go to destination
cd C:\Test
$location = Get-Location
"We are here: $location"
## Get files
$files = Get-ChildItem -recurse
## Get ftp object
$ftp_client = New-Object System.Net.WebClient
$ftp_address = "ftp://user:pass@adress:/home/chardcastle/test"