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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
; | |
; "CMD Prompt Here" PowerToy | |
; | |
; Copyright 1996 Microsoft Corporation | |
; | |
; Modified to launch VS.NET 2010 command prompt 5/6/03 MG | |
; Modified to launch VS.NET 2012 command prompt 9/4/12 KZU | |
; Modified to add context menu to a directory background 9/27/12 SinaIRV | |
[version] |
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
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
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 Set-ConnectionString{ | |
[CmdletBinding(SupportsShouldProcess=$True)] | |
Param( | |
[string]$fileName="app.config", | |
[string]$connectionStringName, | |
[string]$connectionString | |
) | |
$config = [xml](Get-Content -LiteralPath $fileName) | |
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
#!/usr/bin/env ruby | |
require 'koala' # gem install koala --no-ri --no-rdoc | |
# create a facebook app and get access token from here | |
# https://developers.facebook.com/tools/explorer | |
# select "groups", "photos" when authenticating | |
oauth_access_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
group_filtering_words = ['ruby'] | |
image_path = 'image.png' #change to your image path | |
message = 'My Cool image.' # your 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
require 'sinatra' # gem install sinatra --no-rdoc --no-ri | |
set :port, 3000 | |
set :environment, :production | |
html = <<-EOT | |
<html><head><style> | |
#text{width:100%; font-size: 15px; padding: 5px; display: block;} | |
</style></head><body> | |
<input id="text" placeholder="Write then press Enter."/> | |
<div id="chat"></div> |
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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
<# | |
.SYNOPSIS | |
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager | |
.DESCRIPTION | |
This module will return a [PSCredential] object from a credential stored in Windows Credential Manager. The | |
Get-StoredCredential function can only access Generic Credentials. | |
Alias: GSC |
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
<div class="modal hide fade" id="confirm-dialog"> | |
<div class="modal-header"> | |
<a class="close" data-dismiss="modal">×</a> | |
<h3>Confirm</h3> | |
</div> | |
<div class="modal-body"> | |
| |
</div> | |
<div class="modal-footer"> | |
<a href="#" class="btn btn-danger">Ok</a> |
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
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled. | |
Using the code from twitter bootstrap documentation page, this code is customized for table header. | |
Create the table with following layout - | |
<table class="table-fixed-header"> | |
<thead class="header"> | |
<tr> | |
<th>Column 1</th> | |
<th>Column 2</th> | |
<th>Column 3</th> |
OlderNewer