Skip to content

Instantly share code, notes, and snippets.

View adamfisher's full-sized avatar

Adam Fisher adamfisher

View GitHub Profile
@HeathHopkins
HeathHopkins / ExtensionMethods.cs
Last active April 27, 2022 13:33
Xamarin.iOS Extension Methods
using System;
using MonoTouch.UIKit;
namespace System
{
public static class ExtensionMethods
{
public static UIColor ToUIColor(this string hexString)
{
hexString = hexString.Replace("#", "");
@adamloving
adamloving / temporary-email-address-domains
Last active May 31, 2024 15:43
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@pmhsfelix
pmhsfelix / gist:4151369
Created November 26, 2012 23:33
Generating and validating JWT tokens using JWTSecurityTokenHandler
[Fact]
public void First()
{
var tokenHandler = new JWTSecurityTokenHandler();
var symmetricKey = GetRandomBytes(256/8);
var now = DateTime.UtcNow;
var tokenDescriptor = new SecurityTokenDescriptor
{
Subject = new ClaimsIdentity(new Claim[]
@tomraithel
tomraithel / gist:3852171
Created October 8, 2012 12:05
SASS: mixin for absolute center position
@mixin center($width, $height) {
position: absolute;
left: 50%;
top: 50%;
height: $height;
width: $width;
margin-left: - $width / 2;
margin-top: - $height / 2;
}
@nikcub
nikcub / google-serp.user.js
Created September 14, 2012 07:21
rewrite google search result page to link directly to search result url
// Google SERP URL rewrite
//
// User script will rewrite search engine results page for Google and place real
// links to results rather than links that proxy back via google.
//
// So you go straight to the page when you click and you can copy/paste the link
//
// Install:
// 1. Download to desktop/wherever
// 2. Open Chrome extensions page (Window -> Extensions) or URL chrome://extensions
@mattkruskamp
mattkruskamp / RequiredIfAttribute.cs
Created January 1, 2012 12:20
Asp.Net JQuery Unobtrusive Conditional Validation
public class RequiredIfAttribute : ValidationAttribute, IClientValidatable
{
private RequiredAttribute _innerAttribute = new RequiredAttribute();
public string DependentProperty { get; set; }
public object TargetValue { get; set; }
public RequiredIfAttribute(string dependentProperty, object targetValue)
{
this.DependentProperty = dependentProperty;