Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Crifan Li crifan

🎯
Focusing
Block or report user

Report or block crifan

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
@mwaterfall
mwaterfall / StringExtensionHTML.swift
Last active May 24, 2019
Decoding HTML Entities in Swift
View StringExtensionHTML.swift
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244
// 99.99% Credit to Martin R!
// Mapping from XML/HTML character entity reference to character
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
private let characterEntities : [String: Character] = [
// XML predefined entities:
""" : "\"",
"&" : "&",
View git 设置和取消代理
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@jbail
jbail / local-storage-with-json-parse-stringify.js
Created Dec 23, 2012
Local storage with JSON parse and stringify
View local-storage-with-json-parse-stringify.js
var animal = {
name: 'Karl',
type: 'cat',
color: 'black',
age: 7
};
//convert JSON animal into a string
var dehydratedAnimal = JSON.stringify(animal);
@riklomas
riklomas / adding-to-user-admin-form.py
Created Aug 6, 2010
How to add a field to the Django Admin Add User form using UserCreationForm. Add this to a admin.py and alter to whatever fields you'd like
View adding-to-user-admin-form.py
# How to add a field to the Django Admin Add User form
# using UserCreationForm. Add this to a admin.py and alter
# to whatever fields you'd like
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib import admin
You can’t perform that action at this time.