Skip to content

Instantly share code, notes, and snippets.

:octocat:
I may be slow to respond.

jiaxin edison7500

:octocat:
I may be slow to respond.
Block or report user

Report or block edison7500

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
@edison7500
edison7500 / plugin.js
Created Aug 21, 2019
jquery.plugin.js
View plugin.js
import $ from "jquery";
/**
* Generate a jQuery plugin
* @param pluginName [string] Plugin name
* @param className [object] Class of the plugin
* @param shortHand [bool] Generate a shorthand as $.pluginName
*
* @example
* import plugin from 'plugin';
@edison7500
edison7500 / jquery.scrollToTop.js
Last active Aug 21, 2019
jquery.scrollToTop.js
View jquery.scrollToTop.js
import $ from "jquery";
import plugin from "./plugin";
class ScrollToTop {
constructor(element, options) {
const $element = $(element);
$(window).scroll(function () {
if ($(this).scrollTop() > options.offset) {
$element.fadeIn();
@edison7500
edison7500 / model2csv.py
Last active Jul 16, 2019
django command model2csv
View model2csv.py
"""
Prints CSV of all fields of a model.
"""
import csv
import logging
import sys
from django.core.management.base import BaseCommand
You can’t perform that action at this time.