Skip to content

Instantly share code, notes, and snippets.

View memorysaver's full-sized avatar

Ming-Cheng Ho memorysaver

View GitHub Profile
@memorysaver
memorysaver / list.md
Created September 30, 2021 07:42 — forked from ih2502mk/list.md
Quantopian Lectures Saved
@memorysaver
memorysaver / spacemacs-keybindings
Created November 21, 2020 05:49 — forked from adham90/spacemacs-keybindings
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |
@memorysaver
memorysaver / all.py
Created September 18, 2020 04:25 — forked from shashankvemuri/all.py
all of the code
import pandas as pd
import numpy as np
from bs4 import BeautifulSoup as soup
from urllib.request import Request, urlopen
pd.set_option('display.max_colwidth', 25)
# Input
symbol = input('Enter a ticker: ')
print ('Getting data for ' + symbol + '...\n')
@memorysaver
memorysaver / django_admin_mpld3_view.py
Created March 1, 2020 09:47 — forked from leriomaggio/django_admin_mpld3_view.py
Interactive Matplotlib (Bar) Chart with mpld3 in Django Custom Admin View
#----------------------------------------------------------------------------------------
# model.py
#----------------------------------------------------------------------------------------
from django.db import models
from numpy.random import random_sample
class CustomModel(models.Model):
# Put your fields here
def get_data(self):
@memorysaver
memorysaver / README-Template.md
Created December 9, 2017 13:18 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@memorysaver
memorysaver / README.md
Created December 9, 2017 13:17 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@memorysaver
memorysaver / ethereum.md
Created December 7, 2017 19:14 — forked from suhailvs/ethereum.md
pyethapp tutorial

Pyethapp example

Installation

Virtualenv: $ apt-get install virtualenv

Create an env and activate it:

$ virtualenv venv
$ source venv/bin/activate
@memorysaver
memorysaver / postgres-cheatsheet.md
Created November 11, 2017 12:45 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@memorysaver
memorysaver / staticencoder.py
Created August 23, 2017 10:14 — forked from goldhand/staticencoder.py
Django template tag for encoding images in base64 and rendering with server
from django import template
from django.contrib.staticfiles.finders import find as find_static_file
from django.conf import settings
register = template.Library()
@register.simple_tag
def encode_static(path, encoding='base64', file_type='image'):
"""
@memorysaver
memorysaver / gist:0f585e7a5479e1b4fe82d9671fd2c221
Created May 31, 2017 15:14
Simple Google Apps Script to export a single sheet to PDF and email it to a contact list
// Simple function to send Weekly Status Sheets to contacts listed on the "Contacts" sheet in the MPD.
// Load a menu item called "Project Admin" with a submenu item called "Send Status"
// Running this, sends the currently open sheet, as a PDF attachment
function onOpen() {
var submenu = [{name:"Send Status", functionName:"exportSomeSheets"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu('Project Admin', submenu);
}
function exportSomeSheets() {