Skip to content

Instantly share code, notes, and snippets.

View zyqhi's full-sized avatar

LaZyQ zyqhi

View GitHub Profile
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport"/>
<title>HTML5 Canvas 刮刮樂 Demo</title>
<style type="text/css">
#main {border: 1px solid #666;cursor: pointer;}
img.output { border: 1px solid #666; }
</style>
@zyqhi
zyqhi / move-stashes.md
Created November 27, 2019 01:50 — forked from alexeds/move-stashes.md
Move your stashes from one repo to another

Move your stashes from one repo to another


This was useful for me when we created a new branch for a new major release, but were still working on our current version as well. I cloned our repo again and kept the new project on our new branch, but also wanted to get my stashes there.

Download your stashes

git stash show -p > patch

You'll have to specify your stash and name your file whatevery you want. Do this for as all your stashes, and you'll have patch files in your pwd.

@zyqhi
zyqhi / dict_to_string.m
Created May 30, 2019 02:38
Generate JSON string from NSDictionary in iOS
NSString *str = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:dict options:0 error:nil] encoding:NSUTF8StringEncoding];

REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47


NOTES

AppleScript is a rather peculiar scripting language to learn.

@zyqhi
zyqhi / useHexo.md
Last active August 16, 2018 07:25 — forked from btfak/useHexo.md
How to use Hexo and deploy to GitHub Pages
@zyqhi
zyqhi / text_width_size.m
Created February 15, 2016 01:33
获取一段文本在视图上的长度
UIFont *const font = [UIFont systemFontOfSize:15];
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:toastText attributes:@{NSFontAttributeName:font}];
// sz为文本长度
CGSize sz = [string size];
@zyqhi
zyqhi / 0_reuse_code.js
Created February 1, 2016 07:35
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
Hello gist