Skip to content

Instantly share code, notes, and snippets.

if (sampler != null)
{
TextureSamplerUtil.SetSampler(Texture, sampler);
importer.wrapMode = Texture.wrapMode;
importer.wrapModeU = Texture.wrapModeU;
importer.wrapModeV = Texture.wrapModeV;
importer.wrapModeW = Texture.wrapModeW;
importer.filterMode = Texture.filterMode;
importer.SaveAndReimport();
}
uses
ForUsing;
type
TFoo = class
private
FValue: Integer;
public
constructor Create(Value: Integer);
destructor Destroy; override;
unit ForUsing;
interface
type
TUsing<T: class> = record
private
type
TEnumerator = class
private
// ==UserScript==
// @name モーメントの編集で一番上に移動するボタンを追加するやつ
// @namespace http://lyna.space/
// @version 0.1
// @description Twitterのモーメント編集画面に「ツイートを一番上に移動するボタン(⏫)」を追加します。
// @author Lyna
// @match https://twitter.com/i/moments/edit/*
// @grant none
// ==/UserScript==
unit RioGetItFix;
interface
procedure Register;
implementation
uses
Winapi.Windows, System.SysUtils, Vcl.Themes;
@superswanman
superswanman / USushiBreak.pas
Last active December 18, 2016 11:41
TEditControl内にあるTImageListの画像の置き換えサンプル
unit USushiBreak;
interface
uses
System.Classes, Vcl.Controls, Vcl.Graphics, Vcl.Forms, ToolsAPI;
procedure Register;
implementation
unit Lyna.Generators;
interface
uses
SysUtils, Rtti, TypInfo;
type
TRange = record
strict private
type
TObjectHelper = class helper for TObject
public
class function &&op_LogicalOr<T: class>(A, B: T): T; static;
end;
class function TObjectHelper.&&op_LogicalOr<T>(A, B: T): T;
begin
if A <> nil then
Result := A
@superswanman
superswanman / Project1.dpr
Created September 11, 2016 16:04
Use operator overloading for classes with non-ARC compiler
program Project1;
{$APPTYPE CONSOLE}
uses
System.SysUtils, System.Classes, System.Types, Vcl.Dialogs;
type
TStringListEx = class(TStringList)
public