Skip to content

Instantly share code, notes, and snippets.

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 / deepcopy.ts
Created Jan 4, 2018
typescript function for object deep copy
View deepcopy.ts
deepCopy(obj) {
let copy;
// Handle the 3 simple types, and null or undefined
if (null == obj || "object" != typeof obj) return obj;
// Handle Date
if (obj instanceof Date) {
copy = new Date();
jeevan90 / ListFilesInZip.ps1
Last active Feb 13, 2018
list files in zip file using powershell
View ListFilesInZip.ps1
$files = [IO.Compression.ZipFile]::OpenRead($sourceFile).Entries
Write-Host $files
jeevan90 / ArrayContainsInAnotherArray.ps1
Created Feb 13, 2018
array element exists in another array checking in powershell
View ArrayContainsInAnotherArray.ps1
$requiredFruit= @("apple","pear","nectarine","grape")
$someFruit= @("apple","banana","pear","nectarine","orange","grape")
$moreFruit= @("apple","banana","nectarine","grape")
-not @($requiredFruit| where {$someFruit -notcontains $_}).Count
-not @($requiredFruit| where {$moreFruit -notcontains $_}).Count
-not @($requiredFruit| where {$moreFruit -notcontains $_}| select -first 1).Count
View Expand-Archive.ps1
Expand-Archive c:\ -DestinationPath c:\a
jeevan90 / isBase64.js
Created Feb 20, 2018 — forked from RyanNutt/isBase64.js
Check if a String is base64 encoded using JavaScript - from
View isBase64.js
function isBase64(str) {
try {
return btoa(atob(str)) == str;
} catch (err) {
return false;
jeevan90 / IToastMessageService.cs
Created Feb 24, 2018
View IToastMessageService.cs
public interface IToastMessageService
void ShowToastMessage(string message);
View ToastMessageService.cs
[assembly: Xamarin.Forms.Dependency(typeof(ToastMessageService))]
namespace ToastTestXamarin.Droid
public class ToastMessageService : IToastMessageService
public void ShowToastMessage(string message)
Toast.MakeText(Android.App.Application.Context, message, ToastLength.Long).Show();
View MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=""
<Button x:Name="BtnToastMessage" Text="Show Toast" Clicked="ShowToast"></Button>
jeevan90 / MainActivity.cs
Created Mar 15, 2018
Double tap to exit xamarin android
View MainActivity.cs
private bool doubleBackToExitPressedOnce = false;
public override void OnBackPressed()
if (doubleBackToExitPressedOnce)