Skip to content

Instantly share code, notes, and snippets.

Avatar

Donn Felker donnfelker

View GitHub Profile
View LineCount-PowerShell.ps1
(ls -filter "*.cs" -recurse | where { $_.PSIsContainer -eq $false -and (get-content($_.FullName)).Length -gt 1000 }).count
View CountLinesRecursive.ps1
(ls -filter "*.cs" -recurse | where { $_.PSIsContainer -eq $false -and (get-content($_.FullName)).Length -gt 1000 }).count
View NoDblClicl
var loadingUx = '<img src="<%=Url.Content("~/Images/ajax-loader.gif")%>" /> Loading';
$("#my-button-id").click(function () {
// Add loading gif to let user know some kind of party is going on while they wait
$(this).hide();
$(this).parent().append(loadingUx); // Button is in a div of its own
});
View aspnet mvc jquery form action modifier
<html>
<head>
<link href="css/jquery-ui-1.8.custom.css" rel="stylesheet" type="text/css" />
<script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script>
<script>
View ExampleQueries.cs
List<int> userIds = (from item in _userRepository.Fetch()
where item.Name.Contains(search)
|| item.Role.Name.Contains(search)
select item.User.Id);
// Or
var stuff = _repository.Fetch();
var result = stuff.Where(x => x.StuffId== someId && (x.StuffName == null || x.StuffType != null));
View Customer.cs
public class Customer
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int CustomerNumber { get; set; }
public bool IsAwesomeAtFishingForChickenHawks { get; set; }
}
@donnfelker
donnfelker / .gitconfig
Created Mar 21, 2011
My gitconfig for projects that use git-svn
View .gitconfig
[core]
editor = notepad++.exe
whitespace = nowarn
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
[user]
name = myname
email = myname@example.com
[merge]
tool = diffmerge
View ApiPrincipal.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
namespace Example.Core.Security
{
public class ApiPrincipal : GenericPrincipal
{
View main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#6a9938"
>
<TextView
android:layout_height="wrap_content"
@donnfelker
donnfelker / main.xml
Created Aug 3, 2011
spring loading your textviews
View main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#6a9938"
>
<TextView
android:layout_height="wrap_content"