This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
#Encapsualtes hex payload into SiRF binary transport message | |
#Example: sirfmsg.pl a600020500000000 | |
my $payload = pack("H*", $ARGV[0]); | |
my $csum = 0; | |
my $payload_length = map { $csum = ($csum + $_) & 0x7ff } unpack("C*", $payload); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Class::Struct; | |
use Data::Dumper; | |
use Fcntl qw(:flock); | |
use Getopt::Long; | |
use Pod::Usage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#sqlcipher | |
git clone https://github.com/sqlcipher/sqlcipher.git | |
cd sqlcipher | |
./configure --enable-tempstore=yes --enable-load-extension CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" | |
sudo make install | |
cd .. | |
#spatialite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.swiperefreshtest; | |
import android.content.Context; | |
import android.support.v4.widget.SwipeRefreshLayout; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.widget.AbsListView; | |
public class MySwipeRefreshLayout extends SwipeRefreshLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Usage: echo 'UIColor(red:0.643, green:0.549, blue:0.839, alpha: 1)' | uicolor2argb | |
perl -nle 'if (/UIColor\(red\:\s*(\S+)\,\s*green:\s*(\S+)\,\s*blue:\s*(\S+),\s*alpha:\s*(\S)/) { printf "%02x%02x%02x%02x\n", 0.5+255*$4, 0.5 + 255 * $1, 0.5+255*$2, 0.5+255*$3}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Getopt::Long; | |
use Pod::Usage; | |
my $VERSION="0.01"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Demonstration that the Android can destroy background activities on memory pressure without restarting | |
* the application | |
https://cs.android.com/android/platform/superproject/+/android-12.0.0_r4:frameworks/base/core/java/android/app/ActivityThread.java;l=7534 | |
*/ | |
const val ARG_ACTIVITY_NO = "ARG_ACTIVITY_NO" | |
const val TAG = "MainActivity" | |
val gcThresholds = GcActivityMemoryThresholds() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configurations { | |
dependencyScope("graalvmCompiler") | |
resolvable("graalvmCompilerClasspath") { | |
extendsFrom(configurations["graalvmCompiler"]) | |
} | |
} | |
dependencies { | |
add("graalvmCompiler", "org.graalvm.compiler:compiler:24.0.1") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.ByteArrayOutputStream | |
abstract class GitShaValueSource : ValueSource<String, ValueSourceParameters.None> { | |
@get:Inject | |
abstract val execOperations: ExecOperations | |
override fun obtain(): String { | |
return try { | |
val output = ByteArrayOutputStream() | |
execOperations.exec { |