Skip to content

Instantly share code, notes, and snippets.

View donnfelker's full-sized avatar

Donn Felker donnfelker

View GitHub Profile
(ls -filter "*.cs" -recurse | where { $_.PSIsContainer -eq $false -and (get-content($_.FullName)).Length -gt 1000 }).count
(ls -filter "*.cs" -recurse | where { $_.PSIsContainer -eq $false -and (get-content($_.FullName)).Length -gt 1000 }).count
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
});
<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>
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));
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 March 21, 2011 16:43
My gitconfig for projects that use git-svn
[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
@donnfelker
donnfelker / QButton.java
Created April 1, 2011 14:12
A custom Button that uses a custom font for all display.
package com.qonqr.views;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.Button;
public class QButton extends Button {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
namespace Example.Core.Security
{
public class ApiPrincipal : GenericPrincipal
{
@donnfelker
donnfelker / main.xml
Created August 1, 2011 21:09
Rounded Corners
<?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"