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 / 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 / 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 / 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 / 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: [email protected]
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;;
(?bhttp://[-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|]
@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&?/, '');
@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 / 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 / charascii.c
Last active August 29, 2015 14:06
Print ASCII code of a Character (or an ASCII code table)
#include <stdio.h>
#include <conio.h>
/**
* author: [email protected]
* Usage:
* -With Parameter
* CMD: charascii.exe A
* OutPut: A: 65
* -Without Parameter
@rankun203
rankun203 / mwww.sh
Last active August 29, 2015 14:02
监视文件夹并执行操作
#!/bin/bash
#author [email protected]
#ref http://unix.stackexchange.com/a/24955
cd /home/rankun203
inotifywait -r -m ./www -e create -e moved_to |
while read path action file; do
echo "The file '$file' appeared in directory '$path' via '$action'"
rsync -avzrhu --update --progress --chmod=u+rwx,g+rwx,o+rwx "$path$file" [email protected]:/home/rankun203/html/files
done