Skip to content

Instantly share code, notes, and snippets.

View netskink's full-sized avatar

John F. Davis netskink

View GitHub Profile
<head>
<meta charset="utf-8">
<title>Click listener version 1</title>
</head>
<body>
<button id="myButton">Click me!</button></button>
<script id="jsbin-javascript">
var button = document.getElementById("myButton");
// Add an onclick listener to the button
<body onload="init();">
<canvas id="myCanvas" width="400" height="400">
Your browser does not support the canvas tag.
</canvas>
<script id="jsbin-javascript">
var canvas, ctx;
var x=100, y=100;
var incrementX = 0;
function init() {
canvas = document.getElementById('myCanvas');
<body onload="init();">
<canvas id="myCanvas" width="400" height="400">
Your browser does not support the canvas tag.
</canvas>
<script id="jsbin-javascript">
var canvas, ctx;
var x=100, y=100;
var angle=0;
var x = 100;
<!DOCTYPE html>
<html>
<body onload="init()">
<canvas id="canvas" width="400" height="400" style="border:solid 2px black"></canvas>
<ul id="sliders"></ul>
<script id="jsbin-javascript">
var canvas;
var context;
@netskink
netskink / uboot yocto uEnv.txt
Created July 24, 2015 12:25
This is the uEnv.txt file I used to get yocto to boot.
##This will work with: Angstrom's 2013.06.20 u-boot.
loadaddr=0x82000000
fdtaddr=0x88000000
rdaddr=0x88080000
initrd_high=0xffffffff
fdt_high=0xffffffff
loadximage=load mmc 0:2 ${loadaddr} /boot/zImage-3.14.19-yocto-standard
@netskink
netskink / printf_format_specifiers.txt
Created February 6, 2016 12:23
printf format specifiers
Escape sequences are used to display non-printing and hard-to-print characters. In general, these characters control how text is positioned on the screen, for example, newlines and tabs:
Character
Value
Escape Sequence
alert (beep)
0x07
\a
backslash
0x5C
func adjRed(inout pixel:Pixel, by:Int) {
let redDiff = Int(pixel.red) - avgRed
if (redDiff > 0) {
pixel.red = UInt8(max(0,min(255, avgRed + redDiff * by)))
}
}
func adjGreen(inout pixel:Pixel, by:Int) {
let greenDiff = Int(pixel.green) - avgGreen
if (greenDiff > 0) {
; This is for buffer_overflow2.c
; This shell code is 44 bytes in length
;;;;;; Above this line is part of our model for how we get to our
;;;;;; function pointer to call based upon ascii variable decoded in read buffer.
; create a label so we know where to start looking when
; we write the patch file.
initialStart:
jmp theCall
;Program received signal SIGSEGV, Segmentation fault.
; 0xc289c031 in ?? ()
; Cannot access memory at address 0xc289c031
; This is buffer_overflow.c
import XCTest
@testable import SimpleApp
class SimpleAppRandomPerfTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}