Skip to content

Instantly share code, notes, and snippets.

View crifan's full-sized avatar
🎯
Focusing

Crifan Li crifan

🎯
Focusing
View GitHub Profile
@riklomas
riklomas / adding-to-user-admin-form.py
Created August 6, 2010 15:01
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
# 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
@jbail
jbail / local-storage-with-json-parse-stringify.js
Created December 23, 2012 18:08
Local storage with JSON parse and stringify
var animal = {
name: 'Karl',
type: 'cat',
color: 'black',
age: 7
};
//convert JSON animal into a string
var dehydratedAnimal = JSON.stringify(animal);
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
@toastdriven
toastdriven / random.go
Created March 3, 2015 06:53
Random (in Python, Javascript, Go & Swift)
// Remove Me
package main
// package random
import (
"fmt"
"math/rand"
"time"
)
@mwaterfall
mwaterfall / StringExtensionHTML.swift
Last active April 3, 2024 01:33
Decoding HTML Entities in 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:
""" : "\"",
"&" : "&",
@icecr4ck
icecr4ck / idapython_cheatsheet.md
Last active April 17, 2024 14:23
Cheatsheet for IDAPython
@knightsc
knightsc / gist:758783181e41a986fceea6901b8853e3
Created August 20, 2020 13:48
AKNativeAnisetteService.m
//
// AKNativeAnisetteService.m
// akd
//
// Created by Scott Knight on 5/10/19.
// Copyright © 2019 Scott Knight. All rights reserved.
//
#import <AuthKit/AuthKit.h>
#import "AKNativeAnisetteService.h"