Skip to content

Instantly share code, notes, and snippets.

using System.Text;
var RegFieldEncoding = new Dictionary<(int reg, int w), string>()
{
{ (0b000, 0), "al" },
{ (0b000, 1), "ax" },
{ (0b001, 0), "cl" },
{ (0b001, 1), "cx" },
@KyleGobel
KyleGobel / settings.json
Last active September 27, 2020 14:48
Windows Terminal
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"alwaysShowTabs": true,
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"disabledProfileSources": [
"Windows.Terminal.Azure"
],
"initialCols": 120,
"initialRows": 30,
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
if (_testRenderTarget)
{
_spriteBatch.Begin(SpriteSortMode.Immediate);
GraphicsDevice.SetRenderTarget(_renderTarget);
_spriteBatch.Draw(_guiTexture, new Rectangle(0, 0, 64, 64), new Rectangle(0, 0, 64, 64), Color.White);
_spriteBatch.End();
public class Game1 : Game
{
private GraphicsDeviceManager _graphics;
SpriteBatch _spriteBatch;
private bool _testRenderTarget = false;
private Texture2D _guiTexture;
private RenderTarget2D _renderTarget;
public Game1()
// _guiTexture is a texture of a bunch of gui images (buttons, scrollbars panels ect)
// srcRectangle in this case is the source rectange of a 64x64 button
// create render target
// if I set this to the same size of the backbuffer it draws how i expect it, but for some reason
// changing the width/height of this is changing the look when drawn to the screen...
// this doesn't make sense to me because i'm only using 64x64 pixels of this big area...changing it's size
// shouldn't have any effect in my mind
Canvas = new RenderTarget2D(Graphics, 800, 600)

Example Code

<form action="http://www.metroeguide.net/meg_search/Search" method="get" target="_blank">
  <p align="center">  
    <input type="text" name="q" />
    <input type="hidden" name="clientId" value="459" />
    <input type="hidden" name="f" value="51,414,500"/>
    <input type="submit" value="Search" />
  </p>
<form action="http://www.metroeguide.net/search/" method="get" target="meg_menu_display">
<p align="center">
<input type="text" name="q" />
<input type="hidden" name="clientID" value="459" />
<input type="submit" value="Search" />
</p>
</form>
<OBJECT ID="DISystemMonitor1" WIDTH="100%" HEIGHT="100%"
CLASSID="CLSID:C4D2D8E0-D1DD-11CE-940F-008029004347">
<PARAM NAME="_Version" VALUE="458755"/>
<PARAM NAME="_ExtentX" VALUE="21087"/>
<PARAM NAME="_ExtentY" VALUE="16193"/>
<PARAM NAME="DisplayType" VALUE="3"/>
<PARAM NAME="ReportValueType" VALUE="0"/>
<PARAM NAME="MaximumScale" VALUE="100"/>
<PARAM NAME="MinimumScale" VALUE="0"/>
<PARAM NAME="ShowLegend" VALUE="1"/>
@KyleGobel
KyleGobel / instructions.md
Last active August 29, 2015 14:17
Redis Setup

###Instructions

####Setup Sentinel

  1. Copy the sentinel.conf file to /etc/redis/sentinel.conf
  2. Copy the redis-sentinel.sh script to /etc/init.d/redis-sentinel
  3. Give the script execute permissions sudo chmod +x /etc/init.d/redis-sentinel
  4. Start script at boot time sudo update-rc.d redis-sentinel defaults
  5. Copy sentinel to /usr/local/bin/ if you haven't yet
  6. Start sentinel sudo /etc/init.d/redis-sentinel start
@KyleGobel
KyleGobel / data.tsv
Last active August 29, 2015 14:15
sameChart
date product gross_profit
2/19/2015 4 -1397.05
2/18/2015 4 -1834.9384
2/18/2015 9 166.3
2/17/2015 9 134.75
2/17/2015 10 -5.32
2/17/2015 4 -3034.26
2/16/2015 4 -2905.1718
2/16/2015 9 115.7
2/16/2015 10 6.35