This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### PowerShell template profile | |
### Version 1.03 - Tim Sneath <[email protected]> | |
### From https://gist.github.com/timsneath/19867b12eee7fd5af2ba | |
### | |
### This file should be stored in $PROFILE.CurrentUserAllHosts | |
### If $PROFILE.CurrentUserAllHosts doesn't exist, you can make one with the following: | |
### PS> New-Item $PROFILE.CurrentUserAllHosts -ItemType File -Force | |
### This will create the file and the containing subdirectory if it doesn't already | |
### | |
### As a reminder, to enable unsigned script execution of local scripts on client Windows, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ResourceDictionary | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"> | |
<Style TargetType="UserControl"> | |
<Setter Property="Background" Value="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowBackgroundBrushKey}}" /> | |
<Setter Property="Foreground" Value="{DynamicResource {x:Static vs:EnvironmentColors.ToolWindowTextBrushKey}}"/> | |
</Style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### PowerShell personal template profile - Microsoft.PowerShell_profile.ps1 | |
### Version 1.1 - Tim Sneath <[email protected]> | |
### | |
### This file should be stored in $PROFILE.CurrentUserCurrentHost | |
### If $PROFILE.CurrentUserAllHosts doesn't exist, you can make one with the following: | |
### PS> New-Item $PROFILE.CurrentUserCurrentHost -ItemType File -Force | |
### This will create the file and the containing subdirectory if it doesn't already | |
# iPlayer | |
if (Test-Path 'C:\Program Files (x86)\get_iplayer') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Himawari-8 Downloader | |
# | |
# | |
# | |
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image, | |
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background. | |
# | |
# http://himawari8.nict.go.jp/himawari8-image.htm | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup assets | |
$foldersToDelete = ,"$env:ProgramData\Microsoft\VisualStudio\Packages" | |
$foldersToDelete += "$env:AppData\Microsoft\VisualStudio\Packages" | |
$foldersToDelete |? { Test-Path $_ } |% { del -rec -for $_ } | |
# VS assets | |
# Any VS installation folders | |
if (test-path $env:ProgramData\Microsoft\VisualStudio\Packages\_Instances) { | |
gci $env:ProgramData\Microsoft\VisualStudio\Packages\_Instances -filter state.json -recurse | gc -raw | convertfrom-json | select -expand installationPath | del -force -recurse | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApp8 | |
{ | |
class Program | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string GetCurrentFilenameFromEditor() | |
{ | |
var textManager = this.ServiceProvider.GetService(typeof(SVsTextManager)) as IVsTextManager; | |
int mustHaveFocus = 1; | |
textManager.GetActiveView(mustHaveFocus, null, out IVsTextView textView); | |
var userData = textView as IVsUserData; | |
if (userData == null) | |
{ | |
// no text view is currently open |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string GetCurrentFilenameFromEditor() | |
{ | |
var textManager = this.ServiceProvider.GetService(typeof(SVsTextManager)) as IVsTextManager; | |
int mustHaveFocus = 1; | |
textManager.GetActiveView(mustHaveFocus, null, out IVsTextView textView); | |
var userData = textView as IVsUserData; | |
if (userData == null) | |
{ | |
// no text view is currently open |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My dotfiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:http/http.dart' as http; | |
import 'dart:convert'; | |
const dadJokeApi = "https://icanhazdadjoke.com/"; | |
const httpHeaders = const { | |
'User-Agent': 'DadJokes (https://github.com/timsneath/dadjokes)', | |
'Accept': 'application/json', | |
}; | |
main() async { |
OlderNewer