Skip to content

Instantly share code, notes, and snippets.

View konstunn's full-sized avatar

Konstantin konstunn

View GitHub Profile
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def deleteDuplicates(self, head: ListNode) -> ListNode:
cur = head
class Solution:
def plusOne(self, digits: List[int]) -> List[int]:
s = "".join([str(d) for d in digits])
i = int(s)
i = i + 1
s = str(i)
return [int(si) for si in s]
@konstunn
konstunn / lockWS.ps1
Last active March 21, 2017 17:11
PowerShell script to power off display and lock workstation in a couple of clicks or a hotkey stroke. (Found somewhere on the Web.)
# SendMessage(HWND_BROADCAST,WM_SYSCOMMAND, SC_MONITORPOWER, POWER_OFF)
# HWND_BROADCAST 0xffff
# WM_SYSCOMMAND 0x0112
# SC_MONITORPOWER 0xf170
# POWER_OFF 0x0002
Add-Type -TypeDefinition '
using System;
using System.Runtime.InteropServices;
namespace Utilities {