Skip to content

Instantly share code, notes, and snippets.

@godmar
godmar / winbond-t23.patch
Created July 8, 2024 05:09
Support for Winbond W25Q64-Quad
diff --git a/arch/mips/xburst/soc-t23/chip-t23/isvp/common/spi_bus.c b/arch/mips/xburst/soc-t23/chip-t23/isvp/common/spi_bus.c
index cd06b8ac7..cc30f332a 100644
--- a/arch/mips/xburst/soc-t23/chip-t23/isvp/common/spi_bus.c
+++ b/arch/mips/xburst/soc-t23/chip-t23/isvp/common/spi_bus.c
@@ -384,6 +384,27 @@ struct spi_nor_platform_data spi_nor_pdata[] = {
#ifdef CONFIG_SPI_QUAD
.quad_mode = &flash_quad_mode[0],
#endif
+ },
+ {
@godmar
godmar / main.rs
Created July 14, 2021 17:41
test case that triggers mutable_borrow_reservation_conflict
use intrusive_collections::intrusive_adapter;
use intrusive_collections::{LinkedList, LinkedListLink};
// A simple struct containing an instrusive link and a value
struct Test {
link: LinkedListLink,
value: isize,
}
intrusive_adapter!(TestAdapter = Box<Test>: Test { link: LinkedListLink });
@godmar
godmar / map.js
Created June 18, 2020 00:36
output is:
countries = [
{ country: "US", rank: 3 },
{ country: "US", rank: 4 },
{ country: "UK", rank: 3 },
{ country: "UK", rank: 3 },
{ country: "Germany", rank: 7 },
];
let o1 = Object.fromEntries(countries.map(c => [c.country, 1]));
import 'package:objd/core.dart';
class SummonOnlyOnce extends Widget {
Condition preCondition;
Summon summon;
String randomtag;
SummonOnlyOnce(Condition this.preCondition, Summon this.summon) {
this.randomtag = 'F3AAEC1'; // XXX: find out how to make random tag in dart
}
#!/usr/bin/python
# n-m nim
if True:
M, N = 3, 10
else:
M, N = 2, 2
def mex(S):
i = 0
#include <bits/stdc++.h>
using namespace std;
namespace std {
template<typename S1, typename S2> struct hash<pair<S1, S2>>
{
size_t operator()(pair<S1, S2> const& p) const noexcept
{
size_t const h1 ( std::hash<S1>{}(p.first) );
size_t const h2 ( std::hash<S2>{}(p.second) );
@godmar
godmar / wasm-ld.deadlock.txt
Created November 12, 2019 17:47
The copied and pasted fragments below show what happens when wasm-ld locks up in eosio.cdt 1.6.1
Below is a backtrace of the threadpool-related deadlock that occurs in eosio.cdt 1.6.1 while linking with parallel linking enabled.
I've also included the relevant code sections in LLVM and the fix.
(gdb) attach 28855
Attaching to program: /usr/opt/eosio.cdt/1.6.1/bin/wasm-ld, process 28855
[New LWP 28856]
[New LWP 28857]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Petronila Pando  
Jeramy Jarrett  
Mitsue Mandel  
Alfonso Able  
Rae Rubalcava  
Ezra Edison  
Dierdre Demeo  
Marnie Mendes  
Velda Vogel  
Eve Eller  
@godmar
godmar / socket.patch
Created April 30, 2018 03:32
patch for socket.c that turns on TCP_NODELAY
diff --git a/src-solution/socket.c b/src-solution/socket.c
index 112e12b..6f0c402 100644
--- a/src-solution/socket.c
+++ b/src-solution/socket.c
@@ -13,6 +13,7 @@
#include <sys/sendfile.h>
#include <netdb.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <errno.h>
@godmar
godmar / state.patch
Created March 8, 2018 16:59
This patch would link menu items to navigation states. If a state is already defined, the menu item would be { state: "nameofstate", label: "Menu Label" } and then the state would be looked up and the item's path set. Otherwise, it's backwards compatible with what you had before.
diff --git a/src/app/app.js b/src/app/app.js
index 160ad4a..62e6e13 100644
--- a/src/app/app.js
+++ b/src/app/app.js
@@ -359,25 +359,29 @@ import login_template from '../templates/login.html';
});
}
- config.nav_targets.topbar.forEach(function (item) {
- // add the routes from config.