Skip to content

Instantly share code, notes, and snippets.

View ScatteredRay's full-sized avatar

Indy Ray ScatteredRay

  • San Francisco, Ca
View GitHub Profile
{
rocmSupport,
cudaSupport
} :
import ../nixpkgs {
config.cudaSupport = cudaSupport;
overlays = [
(final: prev: {
python3 = prev.python3.override {
packageOverrides = finalPy: prevPy: {

I had some issues trying to troubleshoot unlock of my Xperia 5 IV using Windows 10, and finally got it to work, adding some brief notes here for anyone else running into the issue.

running: .\fastboot.exe oem unlock 0xXXXXXXXXXXXXXXXX

I got FAILED (remote: 'Command not supported in default implementation')

A few things here, first I tried this using 'fastbootd' (gotten there by powerbutton + volume down, and browsing to fastboot) This is differen't than the fastboot you get to via holding Volume Up while plugging into the PC, but it's confusing since fastboot devices works even with default drivers. You know you are in the correct fastboot because the screen remains black, and the LED lights up as and stays 'blue'.

@ScatteredRay
ScatteredRay / test.cgfx
Created April 28, 2022 05:36
Minimal Motion Builder CGFX shader
float4x4 WorldViewProjection : WorldViewProjection < string UIWidget = "None"; >;
struct app2vert {
float4 position : POSITION;
};
struct vert2pixel {
float4 position : POSITION;
};
@ScatteredRay
ScatteredRay / cm.log.conf
Last active July 20, 2021 22:25 — forked from codicesoftware/cm.log.conf
Plastic SCM CLI log configuration file
<log4net>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level %thread %logger - %message%newline" />
</layout>
</appender>
<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="C:\logs\cm.log.txt" />
<appendToFile value="true" />
@ScatteredRay
ScatteredRay / hostnamegen.service
Last active July 1, 2020 22:06
Systemd unique hostname
[Unit]
Description=Generate Unique Hostname
DefaultDependencies=no
Wants=local-fs.target swap.target network-pre.target
After=local-fs.target swap.target
Before=network-pre.target
ConditionPathExists=!/etc/hostname
ConditionPathExists=!/boot/hostname
[Service]
// write the data to one end of the pipe
auto writer_seq =
sequence(
lazy([&]{
printf("writes starting!\n");
}),
transform_done(
repeat_effect(
typed_via(
defer(
@(at-point 'surface-struct
'(
(float3 albedo1 ;)
(float3 albedo2 ;)
(float blend ;)))
@(at-point 'surface-calc
'(
(surface . albedo1 = ... ;)
(surface . albedo2 = ... ;)
@ScatteredRay
ScatteredRay / Templ.cpp
Created June 18, 2017 08:35
Template partial specialization.
template <typename T, typename = void>
struct Foo;
// A
template <typename T>
struct Foo<unique_ptr<T>, typename std::enable_if<std::is_class<T>::value>::type> {...};
// B
template <typename T>
struct Foo<T, typename std::enable_if<std::is_class<T>::value>::type> {...};
@ScatteredRay
ScatteredRay / Bar.cpp
Last active March 7, 2017 22:13
Circular dll build
#include <stdio.h>
#include "Foo.h"
#include "Baz.h"
#undef API
#define API __declspec(dllexport)
#include "Bar.h"
void Bar::Print() {
printf("Bar\n");
@ScatteredRay
ScatteredRay / gist:0f1778aacfef0e75dcbd
Last active August 29, 2015 14:14
Static member existance check
template<typename T>
struct Has_My_Static {
typedef char yes[1];
typedef char no[2];
template<void*> struct exist_check;
template<typename U, U> struct type_check; // Use this for type checking.
#ifdef _MSC_VER
template<typename C> static yes& chk(C*, exist_check<(void*)&C::MyStatic>*);
#else
template<typename C> static yes& chk(C*, typeof(&C::MyStatic));