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
public void SayHello() | |
{ | |
for (int i=0; i<10; i++) | |
{ | |
Console.WriteLine("Hello World") | |
} | |
} |
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
$('.gaDelay').click(function (e) { | |
var element = this; | |
e.preventDefault(); | |
setTimeout(function () { location = element.href }, 100); | |
}); |
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
<issuerNameRegistry type="RelyingParty1.CustomIssuerNameRegistry, RelyingParty1"> | |
<trustedIssuers> | |
<add thumbprint="abcdefghijklmnopqrstuvwxyz1234567890abcd" name="optional name" /> | |
</trustedIssuers> | |
</issuerNameRegistry> | |
using System.IdentityModel.Tokens; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Xml; |
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
<ScrollViewer Margin="2,34,0,0" Grid.RowSpan="2" Name="scrollViewer" VerticalScrollBarVisibility="Auto"> | |
<TextBlock Grid.Row="1" x:Name="tbMessage" TextWrapping="Wrap" Text="A long block of overflowing text goes here." /> | |
</ScrollViewer> | |
private void OnLoaded(object sender, RoutedEventArgs e) | |
{ | |
// Adjust height of window to match text height. Scroll bars shouldn't show. | |
if (scrollViewer.ComputedVerticalScrollBarVisibility == System.Windows.Visibility.Visible) | |
{ | |
scrollViewer.Height += scrollViewer.ScrollableHeight; |
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
// In your HTML helper class, include this function: | |
/// <summary> | |
/// Returns the ViewBag of the parent page. Allows a child view to access the parent view's ViewBag object. A child view may then set a property accessible by the parent page. | |
/// </summary> | |
/// <returns>ViewBag</returns> | |
public static dynamic GetPageViewBag(this HtmlHelper html) | |
{ | |
if (html == null || html.ViewContext == null) //this means that the page is root or parial view | |
{ |
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(XML) | |
require(stringr) | |
# | |
# Grabs all LinkedIn urls from a Coursera forum thread. Perfect for the "Let's Connect!" threads. | |
# Usage: | |
# 1. Open a Coursera forum thread, containing LinkedIn links. | |
# 2. Scroll all the way to the bottom of the page to load all posts in the thread. | |
# 3. Save the web page to an html file named post.htm. | |
# 4. Call linkedInLinks("post.htm") |
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(XML) | |
require(stringr) | |
# | |
# Grabs all names and LinkedIn urls from a Coursera forum thread. Perfect for the "Let's Connect!" threads. | |
# Usage: | |
# 1. Open a Coursera forum thread, containing LinkedIn links. | |
# 2. Scroll all the way to the bottom of the page to load all posts in the thread. | |
# 3. Save the web page to an html file named post.htm. | |
# 4. Call linkedInLinks("post.htm") |
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
doLoop <- function(method, iterations = 1000) { | |
for (i in 1:iterations) { | |
method(); | |
} | |
} | |
# Load csv file. | |
DT <- fread('https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06pid.csv') | |
# Time option 2. |
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
1. Download linux distribution iso. | |
2. Download unetbootin. | |
3. In Windows 8, right-click start icon and select Disk Management. | |
4. Select C: drive and click Shrink. Shrink the disk by the amount you want for the linux drive, for example 30GB. | |
5. Right-click the new unallocated 30GB space and select New Volume. Format it as FAT32 and leave the drive letter blank. | |
6. Run unetbootin. Select the iso you downloaded in step 1. Select Hard Disk and leave the default disk as C:. This will install a temporary boot of the linux "live" iso, also called a frugal install. | |
7. Restart the PC and in the boot menu, choose "unetbootin". This will load the linux live environment. Starting might take a while (maybe 10+ minutes). When the linux logo displays, hit any key on the keyboard to show the terminal screen and status. The part, "scanning disc for index files.." may take a long time, so be patient. | |
8. Once linux starts up, click "Install Linux". | |
9. Keep clicking Continue until you reach the disk drive partition screen. Sel |
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
#!/bin/bash | |
appPath=/usr/share/login-image-changer | |
settingsPath=$appPath/settings.conf | |
rcLocalPath="/etc/rc.local" | |
scriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
runCommand="sudo bash \"$scriptPath/loginimage.sh\" -r" | |
settingsExists=0 | |
install=0 | |
uninstall=0 |
OlderNewer