Skip to content

Instantly share code, notes, and snippets.

View adamnew123456's full-sized avatar

Chris Marchetti adamnew123456

  • Chapel Hill, NC
View GitHub Profile
@adamnew123456
adamnew123456 / cprint.h
Created July 11, 2011 00:12
A Color Printing Library for xterm Compatable Terminals
/*
Copyright (c) 2011, Adam Marchetti
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
@adamnew123456
adamnew123456 / trash.tcl
Created October 28, 2011 01:36
Trash - A Simple Linux CLI Trash Interface
#!/usr/bin/tclsh
# Copyright 2011 Adam Marchetti
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@adamnew123456
adamnew123456 / pyrandr.py
Created October 29, 2011 04:17
PyRandR GTK - A small program to manage screen resolutions and positions
#!/usr/bin/python
#
# Copyright 2010 Adam Marchetti
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@adamnew123456
adamnew123456 / build-intellij.xml
Created March 4, 2012 07:25
Ant Build Templates - Templates for different tasks in Ant
<!-- Basic template setup for compiling Intellij Forms By Hand -->
<project name="NAME" default="dist" basedir=".">
<description>
DESCRIPTION
</description>
<path id="javac2.classpath">
<fileset dir="lib">
<!-- Copy these files to the lib/ directory:
- annotations.jar
#!/usr/bin/tclsh
# A simple gstreamer plugin browser.
package require Tk
pack [entry .searchbox] -fill x
pack [listbox .searchlist] -expand true -fill both
pack [text .detailbox] -expand true -fill both
proc dosearch {} {
.searchlist delete 0 end
@adamnew123456
adamnew123456 / scan.py
Last active December 29, 2017 09:33
Scan Images From HP 3050A Printer/Scanner
"""
Interfacing with the HP 3050A to automate scanning.
Copyright (c) 2014, Adam Marchetti
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
@adamnew123456
adamnew123456 / evilscan.py
Created April 16, 2014 00:22
Scans Images From HP 3050... Using Lambdas
# So, this is a port of a fairly simple script from "normal Python" to "pure-lambda
# Python". This code contains no Python statements, and is a proof-of-concept to show
# what you can do without statements, and how powerful Python's lambdas are despite
# that they are crippled.
#
# A few notes on how to read this:
# 1. Almost everything happens in the arguments. Practially nothing happens
# inside function bodies, since the function bodies are usually just other
# functions. Go down to the bottom of the expression (using your editor's
# paren matching) to see what the arguments are.
@adamnew123456
adamnew123456 / bf-compiler.py
Last active August 29, 2015 14:06
A BrainFuck Compiler For NASM/DOSBox
"""
Compiles BrainFuck programs into x86 assembly.
Supported operators:
> < + - [ ] . ,
Note that this doesn't support Linux for simplicity, and is instead targeted
at DOSBox (due to the fact that Linux buffers stdio while DOSBox does not).
"""
@adamnew123456
adamnew123456 / image-preview.user.js
Last active August 29, 2015 14:07
Inline Preview of Images on Reddit
// ==UserScript==
// @name Image Preview.
// @namespace adamnew123456@gmail.com
// @description Adds inline previews of images on Reddit.
// @include http://www.reddit.com/r/*
// @include http://reddit.com/r/*
// @include http://www.reddit.com/
// @include http://www.reddit.com/?*
// @include http://reddit.com/
// @include http://reddit.com/?*
@adamnew123456
adamnew123456 / eqnmix.html
Last active August 29, 2015 14:10
A Simple Equation Mixer
<html>
<title> Equation Mixer </title>
<body>
<canvas id="grid" width="600" height="600"> </canvas> <br/>
f(x): <input id="func1" type="text" value="Math.sin(x)"> </input>
g(x): <input id="func2" type="text" value="Math.cos(x)"> </input> <br/>
X Min: <input id="xmin" type="text" value="-1"> </input>
X Max: <input id="xmax" type="text" value="1"> </input> <br/>