Skip to content

Instantly share code, notes, and snippets.

View Borluse's full-sized avatar

Fan ZHAO Borluse

  • Tencent
  • Shenzhen, China
View GitHub Profile
@aditya-malte
aditya-malte / smallberta_pretraining.ipynb
Created February 22, 2020 13:41
smallBERTa_Pretraining.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danielbierwirth
danielbierwirth / TCPTestClient.cs
Last active April 27, 2024 20:24
TCP Client-Server Connection Example | Unity | C# | Bidirectional communication sample: Client can connect to server; Client can send and receive messages: Server accepts clients; Server reads client messages; Server sends messages to client
// This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
// To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/
// or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using UnityEngine;
@adamkl
adamkl / ObjectPooling.cs
Created June 17, 2016 19:02
Object pooling
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
namespace Pooling
{
public enum LoadingMode { Eager, Lazy, LazyExpanding };
@hkurokawa
hkurokawa / adb-screenshot.sh
Last active August 30, 2023 06:27
A shell script to take a screen shot of the android device, resize it and copy to clipboard
#! /bin/bash
## This script is for taking a screen shot of an Android device.
## If possible, it tries to resize the image file and then copy to the clipboard.
##
## Note the script generates screenshot_yyyyMMddHHmmss.png and screenshot_yyyyMMddHHmmss_s.png
## under /sdcard on the device (you can specify another location with '-t' option)
## and copies it to the current working directory.
##
## The script passes unrecognized arguments to adb command, which means you can specify "-e" or "-d"
@acgrid
acgrid / gist:4b435b736493dc38b51f
Created February 3, 2015 13:57
Pratical Vim 整理

Pratical Vim 整理

本文档内容基于Drew Neil著作Pratical Vim中译本整理。

模式(Mode)

普通模式(Normal mode)

  • 能够前往其他任一Vim模式
  • 字符命令形式:[{count}=1]{operator},对光标下起的count个字符执行操作并后移光标。
  • 动作命令形式:[{count}=1]{operator}{motion},表示执行operator操作,作用于当前光标+motion指定的范围,并执行count次。
  • 行命令形式:对于动作命令,{operator}{operator}表示将该操作作用于当前行;guugUU是作用于当前行的简化版。
  • 操作符和动作命令均可以自定义,也可与已有的操作符和动作命令组合使用。
@PxlBuzzard
PxlBuzzard / DynamicObjectPool.cs
Last active January 19, 2018 09:33
An object pool written in C# that will create more elements if the pool is empty.
#region Using Statements
using System;
using System.Reflection;
using System.Collections.Generic;
#endregion
namespace CodeSamples
{
/// <summary>
/// A generic-type object pool that can create new objects if empty.
@darktable
darktable / MiniJSON.cs
Created November 30, 2011 23:08
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining