Skip to content

Instantly share code, notes, and snippets.

@uxp
uxp / App-reach.js
Created March 25, 2022 14:53
contrived example
import React from 'react';
import { render } from 'react-dom';
import { Router, Route } from '@reach/router';
const Home = () => (<h2>Home</h2>);
const Admin = ({props}) => (<div><h2>Admin</h2><hr/><div>{props.children}</div></div>);
const Users = () => (<h2>Users</h2>);
const App = () => (
<Router>
@uxp
uxp / bootstrap.sh
Last active November 17, 2017 17:58 — forked from abulte/bootstrap.sh
Build a custom RPI image
#!/bin/bash
# Based on work by Klaus M Pfeiffer at http://blog.kmp.or.at/2012/05/build-your-own-raspberry-pi-image/
# you need to do: "sudo apt-get install binfmt-support qemu qemu-user-static debootstrap kpartx lvm2 dosfstools"
# run with "sudo bootstrap.sh /dev/sd[x]"
# This attempts to build an image without systemd
echo "Use like: sudo bootstrap.sh /dev/sd[x]"
#deb_mirror="http://ftp.debian.org/debian"
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index cd6037677df2..a629390c7896 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -2811,7 +2811,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Alloc>& __str)
- { return getline(__is, __str, __is.widen('\n')); }
+ { return std::getline(__is, __str, __is.widen('\n')); }
# Makefile for blink demo
#TOOLS = arm-linux-gnu
TOOLS = arm-none-eabi
# Assembling with gcc makes it want crt0 at link time.
#AS = $(TOOLS)-gcc
AS = $(TOOLS)-as
# Use the -g flag if you intend to use gdb
#CC = $(TOOLS)-gcc -mcpu=cortex-m3 -mthumb

Analog Read Serial

Hardware List

  • Arduino Uno
  • Breadboard
  • 10k Ohm Potentiometer

Schematic

@uxp
uxp / ruby-enterprise-1.8.7-2012.02_CVE-2013-4164.patch
Last active December 29, 2015 08:59
Backport patch for Ruby Enterprise Edition 1.8.7-2012.02 for the CVE-2013-4164 DOS Vulnerability
diff -ru a/source/test/ruby/test_float.rb b/source/test/ruby/test_float.rb
--- a/source/test/ruby/test_float.rb 2012-02-19 07:09:11.000000000 -0700
+++ b/source/test/ruby/test_float.rb 2013-11-25 11:51:15.000000000 -0700
@@ -171,4 +171,16 @@
assert_raise(ArgumentError) { 1.0 < nil }
assert_raise(ArgumentError) { 1.0 <= nil }
end
+
+ def test_long_string
+ assert_normal_exit(<<-'end;')
@uxp
uxp / ruby-1.8.7-p358_cve-2013-4164.patch
Created November 23, 2013 15:31
Ruby patch for ruby-1.8.7-p358 to fix CVE-2013-4164
diff -ru a/test/ruby/test_float.rb b/test/ruby/test_float.rb
--- a/test/ruby/test_float.rb 2011-12-10 05:17:27.000000000 -0700
+++ b/test/ruby/test_float.rb 2013-11-23 08:27:39.000000000 -0700
@@ -171,4 +171,16 @@
assert_raise(ArgumentError) { 1.0 < nil }
assert_raise(ArgumentError) { 1.0 <= nil }
end
+
+ def test_long_string
+ assert_normal_exit(<<-'end;')
# A super basic color output formatter for MiniTest in 1.9.3
class ColorReporter
attr_reader :io
def initialize io, opts={}
@io = io
@opts = opts
end
def print o
case o
when '.'
@uxp
uxp / gist:6978270
Created October 14, 2013 16:23
Debian Installer build error, similar to: http://lists.debian.org/debian-boot/2013/08/msg00085.html
hplogsdon@deb-7-build-01:~/src/debian-installer/installer/build$ make reallyclean
rm -f ./stamps/tree-unpack-cdrom_isolinux-stamp ./stamps/tree-cdrom_isolinux-stamp ./stamps/extra-cdrom_isolinux-stamp ./stamps/get_udebs-cdrom_isolinux-stamp
rm -f ./tmp/cdrom_isolinux/diskusage.txt
rm -f ./tmp/cdrom_isolinux/all.utf
rm -f ./tmp/cdrom_isolinux/unifont.bdf ./tmp/cdrom_isolinux/tree/lib/unifont.bgf
rm -f pkg-lists/standard-udebs pkg-lists/kernel-module-udebs
rm -rf ./dest/cdrom/initrd.gz ./dest/cdrom/vmlinuz ./dest/cdrom/debian-cd_info.tar.gz
rm -rf ./tmp/cdrom_isolinux
rm -f ./stamps/tree-unpack-cdrom_gtk-stamp ./stamps/tree-cdrom_gtk-stamp ./stamps/extra-cdrom_gtk-stamp ./stamps/get_udebs-cdrom_gtk-stamp
rm -f ./tmp/cdrom_gtk/diskusage.txt
@uxp
uxp / brilliant
Created September 23, 2013 15:37
<noscript>
Your browser does not have
<a href="help/help_javascript.asp"
target="popuphelp"
onclick="wopen('help/help_javascript.asp', 400, 460); return false;"
onkeypress="wopen('help/help_javascript.asp', 400, 460); return false;"
title ="JavaScript info (launches new window)">JavaScript
</a> enabled.
</noscript>