Skip to content

Instantly share code, notes, and snippets.

@ks1024
ks1024 / media-queries.scss
Created May 6, 2016 02:51 — forked from chrisl8888/media-queries.scss
All Media Queries breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }

Raspberry Pi setup

Just wanted a quick start guide for myself so that I wouldn't have to keep rooting through Google to remember all this stuff. Hopefully it helps other people.

If you had other ideas or suggestions please leave a comment.

Useful things to own before you buy a Pi

The first time I bought a Pi I was enormously frustrated with myself because I didn't own all of this stuff. Kept having to order things off of Amazon and wait to get started... very irritating. This is all good stuff to have laying around anyway:

@ks1024
ks1024 / rpi.md
Created April 28, 2016 06:39 — forked from dideler/rpi.md
Collection of useful Raspberry Pi resources.
@ks1024
ks1024 / API.md
Created January 8, 2016 02:53 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@ks1024
ks1024 / tick_data_to_1min.py
Created September 10, 2015 02:59
From tick data to 1min data using pandas
import tushare as ts
import pytz
from datetime import datetime
symbol = '0000001'
trading_date = '2015-09-09'
df = ts.get_tick_data(symbol, trading_date)
df['date'] = trading_date
df['dateTime'] = df['date'] + ' ' + df['time']
tz = pytz.timezone(pytz.country_timezones('cn')[0])
<!-- Shared version number properties -->
<properties>
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
</properties>
<!--
Core utilities used by other modules.
Define this if you use Spring Utility APIs (org.springframework.core.*/org.springframework.util.*)
-->
<dependency>
@ks1024
ks1024 / gist:13d7ce3f3db51871f29f
Created January 28, 2015 11:07
Drupal - load a block
$block = block_load($module, $delta);
$render_array = _block_get_renderable_array(_block_render_blocks(array($block)));
$output = render($render_array);
function rff_custom_block_load($title) {
$block = db_query('SELECT * FROM {block} WHERE title = :title', array(':title' => $title))->fetchObject();
// If the block does not exist in the database yet return a stub block
// object.
if (empty($block)) {
@ks1024
ks1024 / test.py
Last active August 29, 2015 14:03
Subprocess gist
import subprocess as sp
subprocess.call("pwd") # $pwd
subprocess.call(["ls", "-l"]) # $ls -l
# to store output to the output variable
# ex1
p = sp.Popen("date", stdout=sp.PIPE, shell=True)
output, err = p.communicate()
print "Today is", output
@ks1024
ks1024 / gist:265c2becd70fb44cb750
Last active August 29, 2015 14:03
Todo list test

Task list

  • Todo1
  • Todo2
  • Todo3
@ks1024
ks1024 / test.py
Created July 5, 2014 14:42
Argparse gist
#! /usr/bin/env python
import argparse
parser = argparse.ArgumentParser(description="calculate X to the power of Y")
group = parser.add_mutually_exclusive_group() # allow to specify options that conflict with each other
group.add_argument("-v", "--verbose", action="store_true")
group.add_argument("-q", "--quiet", action="store_true")
parser.add_argument("x", type=int, help="the base")
parser.add_argument("y", type=int, help="the exponent")
args = parser.parse_args()