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
/*JSHint Options*/ | |
/*global _gaq */ | |
/* | |
Google Analytics Event Tracking - JSHint Checked | |
Written By Cheyne Wallace - 19th Nov 2012 | |
Click Usage: <a href="http://somewhere" | |
class="ga-track" | |
event_category="Event Category" | |
event_action="Specific Action" | |
event_label="Optional Message" |
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
// =============================================== | |
// The Method That Parses The NetStat Output | |
// And Returns A List Of Port Objects | |
// =============================================== | |
public static List<Port> GetNetStatPorts() | |
{ | |
var Ports = new List<Port>(); | |
try { | |
using (Process p = new Process()) { |
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
# Only change these two variables. | |
# DATABASENAME is used for both the database name and username | |
SET @DATABASENAME = "service_abc"; | |
SET @USERPASSWORD = "password123"; | |
# ======== PERFORM ========= | |
# Drop Database If Exists | |
SET @DROP_DB = concat("DROP DATABASE IF EXISTS ",@DATABASENAME); |
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
# Usage: powershell ExportSchema.ps1 "SERVERNAME" "DATABASE" "C:\<YourOutputPath>" | |
# Start Script | |
Set-ExecutionPolicy RemoteSigned | |
# Set-ExecutionPolicy -ExecutionPolicy:Unrestricted -Scope:LocalMachine | |
function GenerateDBScript([string]$serverName, [string]$dbname, [string]$scriptpath) | |
{ | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-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
@ECHO OFF | |
REM Run this with: dns_export.bat <your_zone_name> | |
ECHO ############################### | |
ECHO ## REMOVING OLD ZONE EXPORT ## | |
ECHO ############################### | |
del C:\Windows\System32\dns\%1.txt | |
ECHO | |
ECHO ########################################### | |
ECHO ## EXPORTING %1 ZONE DNS CONFIGURATION ## | |
ECHO ########################################### |
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
# Add this line to your web app users crontab to start unicorn after reboot | |
@reboot service unicorn start |
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
setInterval(function(){ | |
env.dynamic_loader.load({url:CommonUrl.staticUrl({path:"apps/asana/view/asana_rainbow.js", compute_hash:!1}), allow_cached:!1 , callback:function(a, b) { | |
b && AsanaRainbow.start() | |
}})},1000) |
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
server { | |
listen 80; | |
server_name yoursite.com www.yoursite.com; | |
return 301 https://www.yoursite.com$request_uri; | |
} | |
# HTTPS server | |
server { | |
listen 443; | |
server_name www.yoursite.com yoursite.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
**Routes** | |
resources :books do | |
get 'search', :on => :collection | |
end | |
**Forms** | |
<%= form_with(model: book, local: true) do |form| %> | |
<%= label_tag(:name, "Name:") %> | |
<%= form.text_field :name %> | |
<%= label_tag(:description, "Description:") %> |