Skip to content

Instantly share code, notes, and snippets.

import UIKit
import PlaygroundSupport
func degree2radian(a:CGFloat)->CGFloat {
let b = CGFloat(Double.pi) * a/180
return b
}
func polygonPointArray(sides:Int,x:CGFloat,y:CGFloat,radius:CGFloat,adjustment:CGFloat=0)->[CGPoint] {
let angle = degree2radian(a: 360/CGFloat(sides))
@purpleskyfall
purpleskyfall / minos-style.css
Last active October 13, 2020 13:48
A Minos style Cascading Style Sheets (css) theme for Pandoc. Based on a hexo theme: http://blog.zhangruipeng.me/hexo-theme-minos/
/* A Minos style html theme for Pandoc, thanks for http://blog.zhangruipeng.me/hexo-theme-minos/ */
/* Usage this them by:
pandoc test.md -c minos-style.css --self-contained -o demo.html
*/
body {
font: 16px 'PT Serif', 'STZhongsong', '华文中宋', 'Microsoft Yahei', serif;
max-width: 760px;
margin: auto;
@dashed
dashed / github-pandoc.css
Created September 26, 2013 13:42
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
1. The texture target needs to be GLES20.GL_TEXTURE_EXTERNAL_OES instead of GL_TEXTURE_2D, e.g. in the glBindTexture calls and glTexParameteri calls.
2. In the fragment shader define a requirement to use the extension:
#extension GL_OES_EGL_image_external : require
3. For the texture sampler used in the fragment shader, use samplerExternalOES instead of sampler2D.
Everything below here is all in the C code, no more Java.
4. In the C code, use glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, eglImage) to specify where the data is, instead of using glTexImage2D family of functions.
@sethrylan
sethrylan / checkstyle.gradle
Last active December 25, 2018 07:09
Code Quality Tasks for Android
configurations {
codequality
}
repositories {
mavenCentral()
}
dependencies {
codequality 'com.puppycrawl.tools:checkstyle:5.6'
(autoload 'markdown-mode "markdown-mode.el" "Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md" . markdown-mode))
;; 日本語出力用
(add-hook 'markdown-mode-hook
(lambda ()
(make-local-variable coding-system-for-write)
(setq coding-system-for-write 'utf-8)))