Skip to content

Instantly share code, notes, and snippets.

Andrew Stuntz drews256

Block or report user

Report or block drews256

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gitexample.sh
#!/bin/bash
function simple()
{
echo 'git rebase is great'
mkdir gitexample
cd gitexample
git init
mkdir lib
touch lib/my_thing.rb
View weather.js
$(document).ready(function() {
$("#weather_button").click(function(e) {
console.log(e)
e.preventDefault();
$.ajax({
type: "POST",
data: 'json',
url: 'https://api.openweathermap.org/data/2.5/weather?zip=98229,us&appid=539756b83366c299af98e440614ce980',
success: function(result) {
console.log(result)
View styles.css
h1 {
font-family: 'Roboto', sans-serif;
}
.center {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
View index.html
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script src="weather.js" type="text/javascript"></script>
</head>
<body>
<div class='center'>
View block.rb
def block_run
yield
puts 'ran!'
rescue StandardError
puts 'rescued!'
end
block_run do
puts 'running block'
raise StandardError
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
View 74HC164.ino
#define data 2
#define clock 3
// use binary notation to discribe our number layouts
byte zero = B01111110;
byte one = B00000110;
byte two = B11011010;
byte three = B11010110;
byte four = B10100110;
byte five = B11110100;
View ExampleWebserver.ino
/* modified by Andrew Stuntz 8/12/2016
Thank you arduinoesp.com for the example starter code */
#include <ESP8266WiFi.h>
const char* ssid = "your-ssid";
const char* password = "your-password";
int ledPin = 5; // GPIO5
WiFiServer server(80);
View 8x8MatrixExampleCommonAnode.ino
/*
* 8x8 LED array test1
* display a line of lights moving around the perimeter of the 8x8 matrix
*/
// Arduino pin definitions - (ordered to keep wiring tidy)
int row[] = {14,10,4,12,9,5,8,6}; //rows - driven HIGH for on
int col[] = {17,16,13,2,15,3,7,11}; //columns - driven LOW for on
View 4Digit7Segment.ino
/*
This Arduino code for "4-digit-7-segment-led-display" (KYX-5461AS).
* This code can display one Number in all 4 digit!
* This code can display 4 Numbers each on in specific digit
* This code can also make a Number Countdown (Timers).
author : Oussama Amri (@amriunix)
website : ithepro.com
*/
//display pins
You can’t perform that action at this time.