Skip to content

Instantly share code, notes, and snippets.

View Mark24Code's full-sized avatar
💻
Exploring

Mark24 Mark24Code

💻
Exploring
View GitHub Profile
@Mark24Code
Mark24Code / dmidecode
Created February 26, 2016 03:07 — forked from semenko/dmidecode
Dell XPS 13 2015 model 9343 on Ubuntu 15.04, dmidecode, lsusb, lspci
$ sudo dmidecode
# dmidecode 2.12
# SMBIOS entry point at 0x000f0000
SMBIOS 2.8 present.
<SNIP>
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
@Mark24Code
Mark24Code / tree.md
Created May 11, 2016 08:37 — forked from upsuper/tree.md
一行 Python 实现树

一行 Python 实现树

使用 Python 内置的 defaultdict,我们可以很容易的定义一个树形数据结构:

def tree(): return defaultdict(tree)

就是这样!

Specs

  • Mini PC + Arduino = pcDuino
  • OS: Lubuntu 和 Android 4.0 ICS
  • 本地输出: HDMI
  • 硬件接口与Arduino兼容

Details

  • 支持通过任何I/O接口来连接Arduino的盾板(shield), 允许使用在Arduino中一样的代码.
  • 出厂默认系统安装Ubuntu在NAND flash上. Ubuntu可以从NAND flash或者一个可以启动的microSD卡上启动.
@Mark24Code
Mark24Code / zepto.smoothScroll.js
Created August 18, 2016 03:14 — forked from benjamincharity/zepto.smoothScroll.js
Smooth scrolling with Zepto.js
function smoothScroll(el, to, duration) {
if (duration < 0) {
return;
}
var difference = to - $(window).scrollTop();
var perTick = difference / duration * 10;
this.scrollToTimerCache = setTimeout(function() {
if (!isNaN(parseInt(perTick, 10))) {
window.scrollTo(0, $(window).scrollTop() + perTick);
smoothScroll(el, to, duration - 10);
@Mark24Code
Mark24Code / cheatsheet.py
Created August 27, 2016 04:27 — forked from fuyufjh/cheatsheet.py
My Python Cheatsheet
Python Cheatsheet
=================
################################ Input & Output ###############################
name = input('please enter your name: ')
print('hello,', name)
ageStr = input('please enter your age: ')
age = int(ageStr)
@Mark24Code
Mark24Code / app.py
Created February 16, 2017 12:16 — forked from zaccrites/app.py
Flask Application Factory
import jinja2
from flask import Flask, render_template, request, redirect, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from . import formatting
from .config import get_config
db = SQLAlchemy()
@Mark24Code
Mark24Code / xterm256
Created February 21, 2017 12:00
让中端切换到256色(make terminal/xterm to support 256 color)
# add to .bashrc
# source .bashrc
if [ "$TERM" == "xterm" ]; then
export TERM=xterm-256color
fi
@Mark24Code
Mark24Code / xterm256color
Last active February 21, 2017 12:02
让终端切换到256色(make terminal/xterm to support 256 color)
# add to .bashrc
# source .bashrc
if [ "$TERM" == "xterm" ]; then
export TERM=xterm-256color
fi
@Mark24Code
Mark24Code / Hello.vue
Created March 16, 2017 08:25
使用vuex
<template>
<div class="hello">
<div><p>Hello Components</p></div>
<div>
{{count}}
</div>
<div>
<button @click="increment">Inc</button>
<button @click="decrement">Dec</button>
</div>
@Mark24Code
Mark24Code / nginx_gunicorn.conf
Last active March 23, 2017 14:45
Nginx Conf 4 Gunicorn
worker_processes 1;
user mark24 mark24; # <--
# 'user nobody nobody;' for systems with 'nobody' as a group instead
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
events {
worker_connections 1024; # increase if you have lots of clients
accept_mutex off; # set to 'on' if nginx worker_processes > 1