Skip to content

Instantly share code, notes, and snippets.

View MSIH's full-sized avatar

MSIH LLC MSIH

View GitHub Profile
@MSIH
MSIH / gist:cdb9f048aee97d56086db55091ec8464
Created February 18, 2022 17:54
Get address components from google places
var getAddressProperty = function (place, property, shortName) {
var addressComponents = place.address_components;
for (var componentIndex in addressComponents) {
var component = addressComponents[componentIndex];
var types = component.types;
if (types.length > 0) {
for (var typeIndex in types) {
var type = types[typeIndex];
if (type === property) {
return (shortName) ? component.short_name : component.long_name;
@MSIH
MSIH / gist:af11c595ea28bf0e6cf633124ae9a62b
Created March 12, 2020 20:57
Download the latest VS Code System install file
$url = "https://update.code.visualstudio.com/latest/win32-x64/stable"
$vsCodePath = "D:\Artifacts\Software\Base\Visual Studio Code\"
# the url is s redirect - get the url with filename
$request = Invoke-WebRequest -Uri $url -MaximumRedirection 0 -ErrorAction Ignore
$location = $request.Headers.Location
$location
# output path is paht to vs code folder plus the file name
$output = $vsCodePath + $location.SubString($location.LastIndexOf('/') + 1)
@MSIH
MSIH / gist:ebf947980cb2643bf5d47a25860ef211
Created May 11, 2016 14:37
Check if SharePoint Web Application Exists based on Display Name
# if web application exists
$getSPWebApplication = Get-SPWebApplication | Where-Object {$_.DisplayName -eq $spAppName}
If ($getSPWebApplication -ne $null)
{
# do somehting if exists
}
else
{
write-host "Web Application does not exists"
}
@MSIH
MSIH / gist:5b02bd8f5931b158c1c0
Last active December 5, 2015 19:25
Deserialize JSON Object into Java Class Based on JSON Key
class ClassDeserializer<T> implements JsonDeserializer<T> {
private Class<T> mClass;
private String mKey;
public ClassDeserializer(Class<T> targetClass, String key) {
mClass = targetClass;
mKey = key;
}
@MSIH
MSIH / style.scss
Last active August 29, 2015 14:10 — forked from daz/style.scss
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;