Skip to content

Instantly share code, notes, and snippets.

View jes's full-sized avatar

James Stanley jes

View GitHub Profile
/* magcube solver
* James Stanley 2018
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
/* uncomment this if you want to find new cube sets instead of using the set I settled on, ... */
/*
Speedo converter by jes
How to re-program the board:
Orient the board so the programming header is at top left and the LED is at bottom left.
Pins are as follows, from top:
1. Reset
2. 0 (RX)
3. 1 (TX)
4. +5V
@jes
jes / generate-stencil.pl
Last active February 28, 2021 01:44
Convert a black-and-white PNG into an STL stencil
#!/usr/bin/perl
# XXX: This program is super unfinished. It works for my use case, but you will certainly
# have to modify the constants in order to use it for your use case. Make sure the input
# image is black-and-white. Note that the output triangle mesh is super unoptimised.
#
# This is very MVP.
use strict;
use warnings;

Keybase proof

I hereby claim:

  • I am jes on github.
  • I am jamesstanley (https://keybase.io/jamesstanley) on keybase.
  • I have a public key whose fingerprint is DFA2 CEB9 3F23 7CC5 1F35 3CDE 58AB 852A 0A2C C137

To claim this, I am signing this object:

#!/bin/sh
while read domain
do
(addr=`dig +short $domain | head -n1`; /bin/echo -e "$domain\t$addr") &
done
wait
template < TerminalEnumType template_type >
class Terminal : public JoeLang::Parser::Token
{
public:
Terminal() = default;
virtual ~Terminal() = default;
static Terminal< template_type >* Parse( vector<Token*>::const_iterator& stream_begin, vector<Token*>::const_iterator stream_end );
static TokenEnumType m_tokenType = template_type;
template <std::string literal, std::string name>
std::unique_ptr< LiteralTerminal< literal, name > > LiteralTerminal::Parse( std::string::const_iterator& stream_begin, std::string::const_iterator stream_end )
{
if( ( stream_end - stream_begin ) < literal.size() )
{
if( std::equal( literal.begin(), literal.end(), stream_begin ) )
{
stream_begin += literal.size();
return std::unique_ptr< LiteralTerminal< literal, name > >( new LiteralTerminal< literal, name > );
}
template <std::string literal, std::string name>
std::unique_ptr< LiteralTerminal< literal, name > > LiteralTerminal::Parse( std::string::const_iterator& stream_begin, std::string::const_iterator stream_end )
{
if( ( end - begin ) < literal.size() )
{
if( std::equal( literal.begin(), literal.end(), stream_begin ) )
{
stream_begin += literal.size();
return std::unique_ptr< LiteralTerminal< literal, name > >( new LiteralTerminal< literal, name > );
}
Normal frame:
:: 0.206600 ms
:: 0.212000 ms
:: 0.216400 ms
:: 0.218600 ms
:: 0.222000 ms
(now glutSwapBuffers happens)
:: 7.620100 ms
7.621300 ms
#!/bin/sh
#Take a screenshot, upload it to outpost, and write to IRC
#James Stanley 2010
filename=`date +images/%Y%m%d-%H%M.png`
scrot /home/james/$filename
scp /home/james/$filename pillbox:public_html/$filename &