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
func LoadArticle(res http.ResponseWriter, req *http.Request) { | |
if article, err := FindArticleById(...) | |
if err != nil { | |
handleError(res, err) | |
return | |
} | |
if article == nil { | |
handleNotFound(res, err) | |
} | |
} |
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
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(` | |
[Security.Principal.WindowsBuiltInRole] "Administrator")) | |
{ | |
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!" | |
Break | |
} | |
Write-Host "Hi Art! I will install your working environment." | |
$answer = Read-Host "Continue? (y/n)" | |
if($answer -eq "y"){ | |
Write-Host "Processing..." |
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
<?xml version='1.0' encoding='utf-8' ?> | |
<!--This is the basics - platform (windows or mac)and version number--> | |
<workbook source-platform='mac' version='9.0' xmlns:user='http://www.tableausoftware.com/xml/user'> | |
<!-- build 9000.15.0318.1720 --> | |
<!--No idea what this for --> | |
<preferences> | |
<preference name='ui.encoding.shelf.height' value='250' /> | |
<preference name='ui.shelf.height' value='250' /> | |
</preferences> | |
<!--This is everything you need to know about datasources --> |
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
################## | |
# Privacy Settings | |
################## | |
# Privacy: Let apps use my advertising ID: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0 | |
# To Restore: | |
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1 | |
# Privacy: SmartScreen Filter for Store Apps: Disable | |
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0 |
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
// Functions from Go's strings package usable as template actions | |
// with text/template. | |
// | |
// This approach assumes you have some context type as a receiver, | |
// but if you just need the functions check out the FuncMap variant | |
// below. | |
// | |
// Commented functions are not deemed useful in template actions. | |
// Haven't actually used this, but this is one possible way of doing it. | |
// Another option is to fill a FuncMap with most of the strings package. |
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
-- Create the raw events table | |
CREATE TABLE page_views ( | |
site_id int, | |
path text, | |
client_ip inet, | |
view_time timestamptz default now(), | |
view_id bigserial | |
); | |
-- Allow fast lookups of ranges of sequence IDs |
OlderNewer