Skip to content

Instantly share code, notes, and snippets.

View tormodfj's full-sized avatar
💡
Inventing code

Tormod Fjeldskår tormodfj

💡
Inventing code
View GitHub Profile
# Utilities
cinst 7zip
cinst ConEmu
# Fonts
cinst SourceCodePro
# Coding
cinst git
cinst P4Merge
@andyshora
andyshora / Login.aspx
Created October 11, 2013 14:03
Password protect a website on Windows Azure
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Security" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
public void Login_OnClick(object sender, EventArgs args)
{
if (FormsAuthentication.Authenticate(UsernameTextbox.Text, PasswordTextbox.Text))
FormsAuthentication.RedirectFromLoginPage(UsernameTextbox.Text, NotPublicCheckBox.Checked);
@tony4d
tony4d / p4merge4git.md
Created August 24, 2012 19:00
Setup p4merge as a visual diff and merge tool for git
@gnab
gnab / grep.hs
Last active October 5, 2015 10:27
Haskell stdin grep
import System.Environment
import Data.List
main = do
args <- getArgs
case args of
[word] -> interact $ unlines . filter (isInfixOf word) . lines
_ -> putStrLn "No word to match against specified!"
@joelmartinez
joelmartinez / GameOfLife.cs
Created September 5, 2011 03:24
Conway's Game Of Life in C#
using System;
using System.Threading.Tasks;
namespace Life
{
public class LifeSimulation
{
private bool[,] world;
private bool[,] nextGeneration;
private Task processTask;
@qwertie
qwertie / DateTimePicker.xaml
Last active June 5, 2023 18:31
C# DateTimePicker for WPF
<UserControl x:Class="DTPicker.DateTimePicker"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DTPicker"
xmlns:wpftc="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
mc:Ignorable="d"><!--Uses Calendar in WPFToolkit.dll,
see http://wpf.codeplex.com/releases/view/40535-->
<UserControl.Resources>