Skip to content

Instantly share code, notes, and snippets.

:octocat:

Jason Liu Jasonlhy

:octocat:
Block or report user

Report or block Jasonlhy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .gvimrc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Font
:set guifont=Source\ Code\ Pro:h14
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Hide pointless junk at the bottom, doesn't work in .vimrc for some reason?
:set laststatus=0
:set noshowmode "don't show --INSERT--
:set noruler "don't show line numbers/column/% junk
@it9gamelog
it9gamelog / it-trans.markdown
Last active Aug 2, 2018
香港、中国内地IT詞彙對照表
View it-trans.markdown

一般

English 香港 中国内地
CPU CPU 处理器
RAM RAM, 記憶體 内存
Display Card Display 显卡
Monitor 屏、屏幕
Touch Screen Touch Screen 触摸屏
Power Supply 火牛 电源
@davidfowl
davidfowl / Example1.cs
Last active Oct 10, 2019
How .NET Standard relates to .NET Platforms
View Example1.cs
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@jhoerr
jhoerr / gist:6d3ba86e6f44a30457df
Last active Feb 19, 2018
Getting claims from an IPrincipal
View gist:6d3ba86e6f44a30457df
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Security.Principal;
namespace Common
{
public static class PrincipalExtensions
{
public static IEnumerable<string> Roles(this IPrincipal user)
View Generate Poco Extension LinqPad
public static class LINQPadExtensions
{
private static readonly Dictionary<Type, string> TypeAliases = new Dictionary<Type, string> {
{ typeof(int), "int" },
{ typeof(short), "short" },
{ typeof(byte), "byte" },
{ typeof(byte[]), "byte[]" },
{ typeof(long), "long" },
{ typeof(double), "double" },
{ typeof(decimal), "decimal" },
@elidickinson
elidickinson / max_width_email.html
Created May 6, 2013
Email Template trick: max-width with outlook
View max_width_email.html
<!--[if mso]>
<center>
<table><tr><td width="580">
<![endif]-->
<div style="max-width:580px; margin:0 auto;">
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
View gist:1975644
class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
You can’t perform that action at this time.