Skip to content

Instantly share code, notes, and snippets.

LadyViktoria

Block or report user

Report or block LadyViktoria

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@LadyViktoria
LadyViktoria / Set-WindowStyle.ps1
Created Jul 19, 2017 — forked from Nora-Ballard/Set-WindowState.ps1
Hide, Show, Minimize, Maximize, etc window from Powershell.
View Set-WindowStyle.ps1
function Set-WindowStyle {
param(
[Parameter()]
[ValidateSet('FORCEMINIMIZE', 'HIDE', 'MAXIMIZE', 'MINIMIZE', 'RESTORE',
'SHOW', 'SHOWDEFAULT', 'SHOWMAXIMIZED', 'SHOWMINIMIZED',
'SHOWMINNOACTIVE', 'SHOWNA', 'SHOWNOACTIVATE', 'SHOWNORMAL')]
$Style = 'SHOW',
[Parameter()]
$MainWindowHandle = (Get-Process –id $pid).MainWindowHandle
View ...values-ksh.strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="actions">AC</string>
<string name="app_name">AndroidAPS</string>
<string name="configbuilder">Conf</string>
<string name="openapsma">oAPS</string>
<string name="overview">ov</string>
<string name="profileviewer">NS</string>
<string name="tempbasals">Tmps</string>
<string name="careportal">CP</string>
View gist:c8e50dfaa16b7084acc2189a798df36e
function Enable-Privilege {
param($Privilege)
$Definition = @'
using System;
using System.Runtime.InteropServices;
public class AdjPriv {
[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall,
ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr rele);
[DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
View gist:4e1488eaf3fd811d98586dfe6e35d0aa
# Declare some variables
$WinPE_Folder = "C:\WinPE10"
$WinPE_BuildFolder = $WinPE_Folder + "\WinPE10"
$WinPE_MountFolder = $WinPE_Folder + "\Mount"
$WinPE_Combined = $WinPE_Folder + "\WinPE10_Combined"
$WinPE_Media = $WinPE_Folder + "\Media"
$WinPE_Drivers = $WinPE_Folder + "\Drivers"
$WinPE_AppsFiles = $WinPE_Folder + "\Apps"
New-Item $WinPE_Drivers -Type Directory -force
@LadyViktoria
LadyViktoria / profile-cleanup.cmd
Created Apr 25, 2016 — forked from maciakl/profile-cleanup.cmd
A script to delete user data for those occasions where you just want to nuke all user data without reimaging machine.
View profile-cleanup.cmd
@echo off
REM use this file to run the powershell script bypassing the policy restrictions
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1'"
pause
@LadyViktoria
LadyViktoria / A_DATABASEWEAR.md
Created Apr 7, 2016 — forked from tajchert/A_DATABASEWEAR.md
Android Wear Realm Database Sync
View A_DATABASEWEAR.md

This short code will show how to sync database file using Realm, but can be used for any file that you need to send to Wear (using Data API). It just takes any file, change it to Asset object and send it over to Wear device. Also it can be used Mobile->Wear, and Wear->Mobile.

When you need to sync database just call FileSender.syncRealm(context);, that is it!

DISCLAIMER "Proper" way would be to synchronize each transaction to DB, but it in most cases Wear is used very rarely comparing to mobile, so it would most likely cause a battery drain. My idea was to synchronize it only whene it is needed (so for example when app closes). If you want to make sure that you are using latest DB, just send trigger data using MessageAPI from Wear to Phone with ask of syncing over its database, or keep some timestapm of last edit and check it.

@LadyViktoria
LadyViktoria / mobile-AndroidManifest.xml
Created Mar 16, 2016 — forked from gabrielemariotti/mobile-AndroidManifest.xml
Android Wear: small gist to start an Activity on the mobile handheld from the Android Wear device.
View mobile-AndroidManifest.xml
<service android:name=".ListenerServiceFromWear">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>
You can’t perform that action at this time.