Skip to content

Instantly share code, notes, and snippets.

@hinst
hinst / MyLazarusCodeTyphonColorScheme.xml
Created July 6, 2013 10:41
MyLazarusCodeTyphonColorScheme
<?xml version="1.0"?>
<CONFIG>
<Lazarus>
<ColorSchemes Version="9">
<Names Count="1">
<Item1 Value="MyLazarusCodeTyphonColorScheme"/>
</Names>
<Globals Version="9">
<SchemeMyLazarusCodeTyphonColorScheme>
<ahaGutter Background="clBtnFace"/>
@hinst
hinst / DWordToHTMLColorString.js
Last active September 26, 2016 14:48
DWord to HTML color string
DWordToHTMLColorString =
function(a)
{
var red = a & 0x00FF0000;
var green = a & 0x0000FF00;
var blue = a & 0x000000FF;
var result = 'rgb(' + red + ', ' + green + ', ' + blue + ')';
return result;
};
$scriptDir = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition);
. $scriptDir\AnotherUnit.ps1
function ExceptionCallStackToStrings: TStringDynArray;
var
i: Integer;
frames: PPointer;
begin
SetLength(result, 1 + ExceptFrameCount);
frames := ExceptFrames;
result[0] := BackTraceStrFunc(ExceptAddr);
for i := 0 to ExceptFrameCount - 1 do
result[i + 1] := BackTraceStrFunc(frames[i]);
use std::io::File;
use std::sync::Arc;
use std::io::stdio::println;
use std::iter::AdditiveIterator;
static function_headers_marker: &'static str = "{$region functions_header}";
static function_headers_end_marker: &'static str = "{$endRegion functions_header}";
fn write_line(string: String) {
let string = string.as_slice();
@hinst
hinst / cygwin_ssh_client_keep_alive.txt
Last active January 15, 2018 10:49
Cygwin SSH Client keep alive // how to enable
If you use Cygwin and SSH and you are frustrated because you lose server connection after some time, then this could help you:
create the file cygwin/etc/ssh_config
place the following text:
KeepAlive yes
ServerAliveInterval 60
restart cygwin shell
@hinst
hinst / DelphiBug.dpr
Last active December 25, 2015 12:37
Delphi object reference-counted strings not being released
program Project1;
{$appType console}
uses
FastMM4, SysUtils;
type
TFoo = object
s, ss: string; // these fields are released
@hinst
hinst / about:config
Last active January 20, 2024 17:17
FireFox settings
These settings should be changed to prevent Firefox for Android from releasing tabs
browser.tabs.expireTime = seconds; 0 is never
toolkit.browser.contentViewExpire = seconds; 0 is never
:multi-process:
browser.tabs.remote.autostart true,false
browser.tabs.remote.force-enable true,false
dom.ipc.processCount 1...any
@hinst
hinst / SignalReceiver.go
Last active October 12, 2021 20:06
Signal receiver for Go
package main
import (
"os"
"os/signal"
"syscall"
)
func InstallShutdownReceiver(receiver func()) {
c := make(chan os.Signal, 1)
@hinst
hinst / engineer menu code
Created December 25, 2015 12:35
Android
*#*#3646633#*#*