Skip to content

Instantly share code, notes, and snippets.

View rankun203's full-sized avatar
🔨
building things

Kun R rankun203

🔨
building things
View GitHub Profile
@rankun203
rankun203 / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rankun203
rankun203 / OSXNotes.md
Last active August 29, 2015 14:08
Notes of OSX daily use.

###Finder

Keys:

Desc Key
Move here Option+CMD+V

Commands:

@rankun203
rankun203 / resizeParent.js
Created October 27, 2014 07:57
iFrame resize parent height.
if(parent.frames.length == 0) {
// AW: always be inside a Colnect page
var dst = location.href.replace(/\/forums/, '/forum').replace(/\.php[\?]?/, '!');
top.location.replace(dst);
} else {
try {
url = parent.location.href;
pos = url.search(/\/\w\w(\W|$)/);
lang = url.substring(pos+1,pos+3);
dst = location.href.replace(/\/forums/, '/'+lang+'/forum').replace(/\.php[\?]?/, '!').replace(/lang=\w\w&?/, '');
(?bhttp://[-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|]
@rankun203
rankun203 / importPhotos.sh
Last active August 29, 2015 14:08
Import photos from an Android device that has Developer Options enabled in settings.
#!/usr/bin/env bash
# author: rankun203@gmail.com
mkdir -p ~/tmp/dcim
echo "> Pull all the photos from my Phone?"
select yn in "Yes" "No"; do
case $yn in
Yes ) echo '> Pulling'; adb pull /storage/sdcard0/DCIM/Camera/ ~/tmp/dcim; echo '> Done'; break;;
@rankun203
rankun203 / Glossary.md
Last active August 29, 2015 14:12
Glossary collection.
  1. lorem ipsum

lorem ipsum is a filler text commonly used to demonstrate the graphic elements of a document or visual presentation.

  1. Computer

> computer

@rankun203
rankun203 / designer.html
Created January 22, 2015 11:45
designer
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../ace-element/ace-element.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@rankun203
rankun203 / StringRotator.java
Last active August 29, 2015 14:14
Rotate String
/**
* Created by rankun203 on 2/5/15.
* <p/>
* 初步支持英文符号!http://bbs.csdn.net/topics/230081892
* <p/>
* 你说什么呢?我不知道什么你说的什么
* <p/>
* <pre>
* 么你知呢你
*  说道?说
@rankun203
rankun203 / Angular Material Basic App.markdown
Created August 4, 2015 11:23
Angular Material Basic App
@rankun203
rankun203 / genFileKey.js
Created February 13, 2016 10:36
function genFileKey()
/**
* 根据文件名生成文件的 key
* @param fileName
* @returns {string}
*/
function genFileKey(fileName) {
var fileKey = '';
// 将文件名中的有效字符提取出来作为文件 key
var realFileName = fileName.match(/[\w|\.]/g).join('');