This file contains 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
/*--------------------- | |
INSTRUCTIONS: | |
1. open https://www.facebook.com/me | |
2. run script* | |
3. refresh if necessary, goto 2. | |
* to save as bookmarklet, create new bookmark in your browser of choice - | |
Name: "hide from timeline" | |
URL: "javascript: <content of gist below>" | |
-----------------------*/ |
This file contains 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
function Get-DateTakenFromExifData { | |
param([String] $filePath) | |
try { | |
$imgData = New-Object System.Drawing.Bitmap($filePath) | |
try { | |
[byte[]]$dateTakenExifData = $imgData.GetPropertyItem(36867).Value | |
[string]$dateString = [System.Text.Encoding]::ASCII.GetString($dateTakenExifData) | |
return [datetime]::ParseExact($dateString, "yyyy:MM:dd HH:mm:ss`0", $null) | |
} |
This file contains 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
1 | |
00:01:59,640 --> 00:02:02,000 | |
Там наша родина, друзья мои. | |
2 | |
00:02:06,400 --> 00:02:08,320 | |
Сквозь бури и ветер, | |
3 | |
00:02:09,760 --> 00:02:12,880 |
This file contains 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
// property can have dot notation, eg 'parent.child.value' | |
export const getPropertyValue = (obj: any, property: string) => | |
property.split('.').reduce((a, b) => (a ? a[b] : undefined), obj); | |
// property can have dot notation, eg 'parent.child.value' | |
export const setPropertyValue = (obj: any, property: string, value: any) => { | |
const keys = property.split('.'); | |
const lastKey = keys.pop()!; | |
let currentObj = obj; | |
keys.forEach((key) => { |
This file contains 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 { createContext, PropsWithChildren, useContext, useState } from 'react'; | |
interface IContext { | |
getValue: <T>(key: string) => T | undefined; | |
setValue: <T>(key: string, value: T) => void; | |
} | |
const AppStateContext = createContext<IContext | undefined>(undefined); | |
const AppStateContextProvider = ({ children }: PropsWithChildren<{}>) => { |
This file contains 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
; Disable "Show more options" context menu | |
[HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32] | |
@="" | |
; Disable web search from start menu | |
[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer] | |
"DisableSearchBoxSuggestions"=dword:00000001 |
This file contains 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
HttpContext.Current = new HttpContext( | |
new HttpRequest("", "http://tempuri.org", ""), new HttpResponse(new StringWriter())); | |
NameValueCollection headers = HttpContext.Current.Request.Headers; | |
Type t = headers.GetType(); | |
const BindingFlags nonPublicInstanceMethod = BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance; | |
t.InvokeMember("MakeReadWrite", nonPublicInstanceMethod, null, headers, null); | |
t.InvokeMember("InvalidateCachedArrays", nonPublicInstanceMethod, null, headers, null); |
This file contains 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
void Main() | |
{ | |
var santas = new[] | |
{ | |
// TODO: Fill out names and email addresses of all participants | |
new Santa("Person 1", "person1@example.com"), | |
new Santa("Person 2", "person2@example.com"), | |
new Santa("Person 3", "person3@example.com"), | |
new Santa("Person 4", "person4@example.com"), | |
}; |
This file contains 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
function Get-DateTakenFromExifData { | |
param([String] $filePath) | |
try { | |
$imgData = New-Object System.Drawing.Bitmap($filePath) | |
try { | |
[Byte[]]$dateTakenExifData = $imgData.GetPropertyItem(36867).Value | |
[String]$dateString = [System.Text.Encoding]::ASCII.GetString($dateTakenExifData) | |
return [DateTime]::ParseExact($dateString, "yyyy:MM:dd HH:mm:ss`0", $null) | |
} |
This file contains 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.Concurrent; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.SqlClient; | |
using System.IO; | |
using System.Text; | |
using System.Web; | |
using Microsoft.WindowsAzure.ServiceRuntime; |
NewerOlder