Skip to content

Instantly share code, notes, and snippets.

View pokk's full-sized avatar
🌀

Jieyi pokk

🌀
View GitHub Profile
This is atom setting.
@pokk
pokk / README.md
Last active July 23, 2018 06:59
Redirect file stdin in PyCharm

Introduction

For Pycharm IDE, we want to use redirect input file while running the code.

How to Use

  1. You can make a file for a input data as like *.in.
  2. Typing auto_redirect_input_file.py in top of code.
  3. Click the "Edit Configuration".
  4. Put the file name *.in in "Script parameters".
@pokk
pokk / Math symbols.md
Last active February 9, 2017 16:14
Math symbols

Introduction

There are many math symbols for creating a math formula.

Usually using math symbol

+ ± - × ‧÷ ± = ≠ ≒ ≡ ≦ ≧ ≌ ∞ ∝ Σ π ㎡ % ℃ ℉ √ ‱ ‰ № ℀ ℁ ℅ ℆ ⅍

@pokk
pokk / README.md
Last active January 18, 2017 04:21
Simple Timer

Introduction

How to use the NSTimer in Swift.

Note

  1. parameter repeats: true -> repeat, false -> no repeat.
  2. We don't have to call 'timer.fire()' before NSTimer of the method of scheduledTimerWithTimeInterval. Those will fire automatically.
@pokk
pokk / README.md
Last active April 5, 2017 02:12
Eazy way to run once for each cell in a map

Introduction

We use itertools.product lib to run a map instead of double for loop.

Detail

This functions is actually creating a Cartesian product.

Talk is cheap. Show me the code.

@pokk
pokk / README.md
Last active March 31, 2017 07:57
Limit the number of lines in Textarea

Introduction

Limit the number of lines in Textarea.

Html

<textarea data-limit-rows="true" cols="60" rows="4"></textarea>
@pokk
pokk / README.md
Last active March 31, 2017 07:52
Automatically jump to next item

Intrduction

When we click enter key, when can foucs to next item automatically.

Javascript

$('body').on('keydown', 'input, select, textarea', function (e)
{
@pokk
pokk / README.md
Last active October 12, 2016 00:43
Get enum description

Intrduction

Get enum description from enum class, similar get variable name directly.

@pokk
pokk / README.md
Created October 12, 2016 00:57
Using a heyperlink at TextView in iOS

Introduction

In Xmarin, we basically used c# language to develop an iOS application, we need to use hyperlink in textview.
But if we wanna change to Obj-c code, that's the same grammar.

@pokk
pokk / README.md
Last active April 5, 2017 02:42
A great variety of timer in Android