Skip to content

Instantly share code, notes, and snippets.

@rtfb
rtfb / goodbad.md
Created September 14, 2024 13:15
Good and bad output examples for run12.py

Good output:

ttboard.project_mux: Enable design tt_um_rtfb_collatz
ttboard.pins.standard: Disabling pwm on rp_projclk
ttboard.demoboard: First time loading: Toggling project reset
ttboard.demoboard: Changing reset to output mode
ttboard.demoboard: Changing reset to output mode
Iters: 8
@rtfb
rtfb / run12.py
Last active September 14, 2024 18:35
A script to run the Collatz design on TT05 with a fixed input
from machine import Pin
BITS = 144
BYTES = BITS >> 3
# enable the design
tt.shuttle.tt_um_rtfb_collatz.enable()
# tt.clock_project_stop()
# reset the design
@rtfb
rtfb / main.go
Created July 28, 2017 19:36
A complete example of a custom Blackfriday v2 renderer with pygmentizing CodeBlock handler
package main
import (
"fmt"
"io"
"os/exec"
bf "gopkg.in/russross/blackfriday.v2"
)
@rtfb
rtfb / omitcontents.go
Created July 9, 2017 12:35
This example overrides the default HTML renderer to produce only header and footer, but omit the document body. That's an equivalent of using `HTML_OMIT_CONTENTS` with Blackfriday v1.
package main
import (
"fmt"
"io"
"github.com/russross/blackfriday.v2"
)
// OmitContentsRenderer is a thing.
@rtfb
rtfb / custom-html.go
Last active September 1, 2018 02:25
Demonstrates a simple usage of AST in Blackfriday v2
package main
import (
"bytes"
"fmt"
bf "gopkg.in/russross/blackfriday.v2"
)
func main() {
import itertools
def xprf(l):
return l[0] + 13*float(l[1])/float(l[2]) + l[3] + 12*l[4] - l[5] - 11 + float(l[6])*float(l[7])/float(l[8]) - 10
def xpri(l):
if l[1] % l[2] != 0:
return -1
@rtfb
rtfb / gist:bc60c54f0c84792c5db4
Created July 9, 2014 18:14
Sample patch to add custom column names in gorm
diff --git a/main_test.go b/main_test.go
index 24e0118..1ab61c8 100644
--- a/main_test.go
+++ b/main_test.go
@@ -146,6 +146,12 @@ type Animal struct {
UpdatedAt time.Time
}
+type MappedFields struct {
+ Id int64 `name:"o_id"`

All or substantially all non-text content has short alternative descriptions, usually provided via alt attributes.

Visas ar beveik visas netekstinis turinys turi trumpus alternatyvius aprašus, įprastai nurodomus per alt atributą.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:baselineAligned="false"
android:divider="?android:attr/dividerHorizontal"
android:orientation="horizontal"
android:showDividers="middle"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 57b4adb..c234246 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -62,7 +62,9 @@
<activity android:name="InstallProgress"
android:theme="@style/VimTheme"
android:launchMode="singleInstance"
+ android:excludeFromRecents="true"
android:label="@string/install_activity"