Skip to content

Instantly share code, notes, and snippets.

Cory Fowler SyntaxC4

Block or report user

Report or block SyntaxC4

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
View Microsoft.PowerShell_profile.ps1
$HOST.UI.RawUI.ForegroundColor="Green"
$HOST.UI.RawUI.BackgroundColor="Black"
Function gig {
param(
[Parameter(Mandatory=$true)]
[string[]]$list
)
$params = $list -join ","
Invoke-WebRequest -Uri "https://www.gitignore.io/api/$params" | select -ExpandProperty content | Out-File -FilePath $(Join-Path -path $pwd -ChildPath ".gitignore") -Encoding ascii
@SyntaxC4
SyntaxC4 / web.config
Last active Aug 29, 2015
Laravel 5.1.4 Web.config
View web.config
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
@SyntaxC4
SyntaxC4 / main.py
Created Dec 12, 2014
Connecting to Azure Redis Cache from Python
View main.py
import redis
r = redis.StrictRedis(host='[cache-name].redis.cache.windows.net', port=6380, db=0, password='[access-key]', ssl=True)
r.set('foo','bar')
result = r.get('foo')
print result
View .user.antixss.ini
;Read more: http://php.net/manual/en/session.configuration.php#ini.session.cookie-httponly
session.cookie_httponly=1
@SyntaxC4
SyntaxC4 / Create-Primary-Environment.ps1
Last active Aug 29, 2015
Environment Setup for Dev/Test
View Create-Primary-Environment.ps1
function Get-ScriptDirectory {
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
}
$FunctionToRegister = Join-Path (Get-ScriptDirectory) "setup\Invoke-AzureEnvironmentSetup.ps1"
. "$FunctionToRegister"
#### Primary Environment
$EnvironmentSubscriptionName = "Primary Subscription Name"
@SyntaxC4
SyntaxC4 / Clear-WebPICache.ps1
Last active Aug 29, 2015
Windows Azure Boot Camp (Training) Resource Kit
View Clear-WebPICache.ps1
gci -Force "$env:localappdata\Microsoft\Web Platform Installer" | Remove-Item -Recurse -Force
gci -Force "$env:appdata\Microsoft\Web Platform Installer" | Remove-Item -Recurse -Force
@SyntaxC4
SyntaxC4 / PostBuildEvent
Last active Aug 29, 2015
This target file can be used to deploy WebJobs via WebDeploy (Visual Studio Publish)
View PostBuildEvent
rem Replace [WebProjectName] with the name of your Web Application project name
xcopy "$(TargetDir)*.*" "$(SolutionDir)[WebProjectName]\App_Data\jobs\continuous\$(ProjectName)\" /y
@SyntaxC4
SyntaxC4 / composer.json
Last active Aug 29, 2015
Interacting with the Windows Azure Management API with Guzzle PHP
View composer.json
{
"require": {
"guzzle/guzzle": "~3.1"
}
}
@SyntaxC4
SyntaxC4 / Microsoft.PowerShell_profile.ps1
Created Feb 2, 2014
PowerShell Prompt for LOST fans...
View Microsoft.PowerShell_profile.ps1
# It's your choice if you want to enter the code and press the button.
# >: 4 8 15 16 23 42
function prompt {
write-host '>:' -nonewline
return ' '
}
@SyntaxC4
SyntaxC4 / change-post-git-colors.md
Last active Mar 31, 2018
Changing Colors in Posh-Git
View change-post-git-colors.md

Changing color settings in Poshgit

  1. Navigate to the Poshgit Install Directory

    • [Chocolatey] C:\tools\Poshgit\dahlbyk-posh-git-9d624ca\
    • [Local User] %UserProfile%\Documents\WindowsPowerShell\Modules\Poshgit
    • [System] %windir%\System32\WindowsPowerShell\Modules\Poshgit
  2. Right-Click on GitPrompt.ps1 and select Edit

  3. Between line 5 and 39 you will find all of the colour settings

You can’t perform that action at this time.