- Fix error parsing
- Add missing
yield
in thelogin
function
# Loosely based on http://www.vistax64.com/powershell/202216-display-image-powershell.html | |
[void][reflection.assembly]::LoadWithPartialName("System.Windows.Forms") | |
$file = (get-item 'C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg') | |
#$file = (get-item "c:\image.jpg") | |
$img = [System.Drawing.Image]::Fromfile($file); | |
# This tip from http://stackoverflow.com/questions/3358372/windows-forms-look-different-in-powershell-and-powershell-ise-why/3359274#3359274 |
# Put this in your PowerShell profile. | |
function Elevate-Process | |
{ | |
<# | |
.SYNOPSIS | |
Runs a process as administrator. Stolen from http://weestro.blogspot.com/2009/08/sudo-for-powershell.html. | |
#> | |
$file, [string]$arguments = $args | |
$psi = New-Object System.Diagnostics.ProcessStartInfo $file |
# PowerShell Drag & Drop sample | |
# Usage: | |
# powershell -sta -file dragdrop.ps1 | |
# (-sta flag is required) | |
# | |
Function DragDropSample() { | |
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
$form = New-Object Windows.Forms.Form | |
$form.text = "Drag&Drop sample" | |
$listBox = New-Object Windows.Forms.ListBox |
function New-Symlink { | |
<# | |
.SYNOPSIS | |
Creates a symbolic link. | |
#> | |
param ( | |
[Parameter(Position=0, Mandatory=$true)] | |
[string] $Link, | |
[Parameter(Position=1, Mandatory=$true)] | |
[string] $Target |
param( | |
[Parameter(Position=0)] | |
$Item, | |
[Switch] $WhatIf, | |
[String] $AppConfig = "$env:HOMEDRIVE$env:HOMEPATH\AppConfig", | |
[String] $BaseDir = ".", | |
[Parameter(ParameterSetName="register")] | |
[Switch] | |
$Register, |
<?php | |
/** | |
* Array2XML: A class to convert array in PHP to XML | |
* It also takes into account attributes names unlike SimpleXML in PHP | |
* It returns the XML in form of DOMDocument class for further manipulation. | |
* It throws exception if the tag name or attribute name has illegal chars. | |
* | |
* Author : Lalit Patel | |
* Website: http://www.lalit.org/lab/convert-php-array-to-xml-with-attributes | |
* License: Apache License 2.0 |
[alias] | |
# Source: http://stackoverflow.com/questions/7066325/how-to-list-show-git-aliases#answer-7067489 | |
# Found on stackoverflow list all available aliases == | |
alias = config --get-regexp '^alias.*' | |
s = status | |
ss = status --short | |
ssb = status --short --branch | |
co = commit |
<?php | |
/** | |
* Returns UNIX timestamp from a NTP server (RFC 5905) | |
* | |
* @param string $host Server host (default is pool.ntp.org) | |
* @param integer $timeout Timeout in seconds (default is 10 seconds) | |
* @return integer Number of seconds since January 1st 1970 | |
*/ | |
function getTimeFromNTP($host = 'pool.ntp.org', $timeout = 10) |
import axios from "axios"; | |
import { settings } from "../settings"; | |
import { authAPI } from "."; | |
const request = axios.create({ | |
baseURL: settings.apiV1, | |
}); | |
request.interceptors.request.use( | |
(config) => { |