Skip to content

Instantly share code, notes, and snippets.

@jeevan90
jeevan90 / deploy-static.ps1
Created Dec 3, 2017 — forked from chardcastle/deploy-static.ps1
Upload files (recursive) via powershell
View deploy-static.ps1
## 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"
@jeevan90
jeevan90 / isBase64.js
Created Feb 20, 2018 — forked from RyanNutt/isBase64.js
Check if a String is base64 encoded using JavaScript - from https://stackoverflow.com/a/34068497/1561431
View isBase64.js
function isBase64(str) {
try {
return btoa(atob(str)) == str;
} catch (err) {
return false;
}
}
@jeevan90
jeevan90 / introrx.md
Created Apr 19, 2018 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
View npm-scripts-for-docker.md

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

View StartingWithDocker.md

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.
@jeevan90
jeevan90 / http-server.js
Created Jun 17, 2018 — forked from duluca/http-server.js
No plug-in http server for Node.js
View http-server.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);
@jeevan90
jeevan90 / woocommerce-update-prices.sql
Last active Sep 1, 2018 — 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
View woocommerce-update-prices.sql
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
@jeevan90
jeevan90 / composing-software.md
Created Oct 12, 2019 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series
@jeevan90
jeevan90 / StreamComparer.cs
Created Dec 19, 2018 — forked from sebingel/StreamEquals.cs
Compare two streams bit by bit in C#
View StreamComparer.cs
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");