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
/* | |
* Web service auth example | |
* - ReferencedWebService is the Web Reference service object | |
* and should be replaced with your actual service object | |
*/ | |
ReferencedWebService webService = new ReferencedWebService(); | |
webService.Url = "http://webservice.com/service.asmx"; | |
webService.PreAuthenticate = true; | |
webService.Credentials = new System.Net.NetworkCredential("username", "password"); | |
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
var hostarray = new Array(); | |
hostarray["subdomain.somewhere.com"] = "subdomain.somewhere.com/application/home.html"; | |
function redirect() | |
{ | |
//Obtain the host name in lowercase format | |
var lhost = new String(location.host); | |
lhost = lhost.toLowerCase(); |
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
=begin | |
This is the actual C-based implementation of Array#shuffle! in ruby-1.9: | |
/* | |
* call-seq: | |
* array.shuffle! -> array | |
* | |
* Shuffles elements in _self_ in place. | |
*/ |
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
export PATH="~/bin:/usr/local/bin:/usr/local/sbin/:/opt/local/bin:/opt/local/sbin:$PATH" | |
# prompt display data | |
function rvm_selected_ruby { | |
rb=$(~/.rvm/bin/rvm-prompt) | |
case "$rb" in | |
"system" ) | |
return | |
;; | |
* ) |
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
/var/www/myapp/current/log/newrelic_agent.log { | |
weekly | |
size 5M | |
create 700 deploy deploy | |
rotate 2 | |
} | |
/var/www/myapp/current/log/process_alert.log { | |
weekly | |
size 5M |
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
<script type="text/javascript"> | |
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'YOUR_ID_HERE']); | |
_gaq.push(['_trackPageview']); | |
</script> | |
<script src="//www.google-analytics.com/ga.js" type="text/javascript" async></script> |
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
module IRBExtensions | |
# Load a gem into IRB regardless of Bundler trickery. This method leaves | |
# $LOAD_PATH altered, in order to allow #autoload to work properly. | |
# | |
# Inspired by: | |
# https://gist.github.com/955611 | |
# https://gist.github.com/932231 | |
# | |
# IRB.require_gem 'looksee' | |
# IRB.require_gem 'awesome_print', :as => 'ap' |
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
$ rvm --version | |
rvm 1.16.6 (master) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/] | |
$ which gcc-4.2 | |
/usr/local/bin/gcc-4.2 | |
$ gcc-4.2 --version | |
i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) | |
Copyright (C) 2007 Free Software Foundation, Inc. |
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"?> | |
<root> | |
<item> | |
<name>Das Keyboard for Mac (through KVM)</name> | |
<item> | |
<name>Enable Power/Sleep Button</name> | |
<appendix>F1 to Power</appendix> | |
<appendix>Fn+F1 to F1</appendix> | |
<identifier>private.enable_power_sleep_button</identifier> |
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 the Windows Azure Active Directory Module for Windows PowerShell | |
# | |
# Connect to the tenant to modify | |
Connect-MsolService # => login | |
# Get Service Principal to add the role to | |
$servicePrincipal = Get-MsolServicePrincipal -ServicePrincipalName Principal.Name | |
# Get role object ID | |
# Alternatively, you can list all the roles (in order to get a different role name) using just `Get-MsolRole` |
OlderNewer