Skip to content

Instantly share code, notes, and snippets.

View CaptureScreen.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.IO;
[RequireComponent(typeof(Camera))]
public class CaptureScreen : MonoBehaviour {
void OnGUI() {
if(GUI.Button(new Rect(Vector2.zero, 100 * Vector2.one), "截屏"))
{
@jesliwang
jesliwang / GitReadMe.md
Created Oct 13, 2018
使用git的时候,遇到的问题
View GitReadMe.md
  1. merge操作会更新改动的文件的标记,所以不能用discard来忽略改动 如果discard了,可以用checkout指定分支的文件来解决

    git checkout --

@jesliwang
jesliwang / RMGmail.md
Last active Oct 13, 2018
自动删除gmail的邮件
View RMGmail.md
function Intialize() {
  return;
}

function Install() {
  ScriptApp.newTrigger("purgeGmail")
           .timeBased().everyMinutes(10).create();

}
View Qsqrt.c
float Q_rsqrt( float number ) {
long i; float x2, y; const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
#ifndef Q3_VM #
@jesliwang
jesliwang / .py
Created Dec 30, 2017
批量修改图片尺寸
View .py
#!/Users/Jesli/anaconda2/bin/python
# -*- coding: utf-8 -*-
# pip install pillow
from PIL import Image
image_size = [36, 48, 72, 96, 144, 192]
@jesliwang
jesliwang / pbr.glsl
Created Jun 12, 2017 — forked from galek/pbr.glsl
PBR GLSL SHADER
View pbr.glsl
in vec2 v_texcoord; // texture coords
in vec3 v_normal; // normal
in vec3 v_binormal; // binormal (for TBN basis calc)
in vec3 v_pos; // pixel view space position
out vec4 color;
layout(std140) uniform Transforms
{
mat4x4 world_matrix; // object's world position
You can’t perform that action at this time.