Skip to content

Instantly share code, notes, and snippets.

View disassembly
000000 121a JP 0x21a
000002 434f SNE V3, 0x4f
000004 4e4e SNE Ve, 0x4e
000006 4543 SNE V5, 0x43
000008 5434 DW 0x5434
00000a 2062 CALL 0x62
00000c 7920 ADD V9, 0x20
00000e 4461 SNE V4, 0x61
000010 7669 ADD V6, 0x69
000012 6420 LD V4, 0x20
@taniarascia
taniarascia / hexdump.js
Last active Aug 4, 2020
Hex dump in JavaScript (Node.js)
View hexdump.js
const fs = require('fs')
const filename = process.argv.slice(2)[0]
function hexdump(filename) {
let buffer = fs.readFileSync(filename)
let lines = []
for (let i = 0; i < buffer.length; i += 16) {
let address = i.toString(16).padStart(8, '0') // address
let block = buffer.slice(i, i + 16) // cut buffer into blocks of 16
View React.md

React Notes

  • A React component can only return one parent element.
return <h1>Hello</h1><p>World</p>            // error
return <div><h1>Hello</h1><p>World</p></div> // okay 
  • JavaScript expressions can be interpolated in JSX with {}
@taniarascia
taniarascia / php-pdo-mysql-crud.md
Created May 4, 2017 — forked from odan/php-pdo-mysql-crud.md
Basic CRUD operations with PDO and MySQL
View php-pdo-mysql-crud.md

Basic CRUD operations with PDO

CRUD = Create, Read, Update, Delete

Open a database connection

$host = '127.0.0.1';
$dbname = 'test';
$username = 'root';
@taniarascia
taniarascia / git-deploy.bash
Last active Mar 31, 2020
Track, commit, and push to git origin and development with bash script
View git-deploy.bash
#!/bin/bash
read -r -p 'Commit message: ' ${desc} # prompt user for commit message
git add . # track all files
git add -u # track all deleted files
git commit -m "$desc" # commit with message
git push origin master # push to origin
git push production master # push to development server
View fetch.js
fetch('./js/data.json').then(response => {
return response.json();
}).then(data => {
console.log(data);
}).catch(err => {});
@taniarascia
taniarascia / header-scroll.js
Created Sep 30, 2015
Change Header Color on Scroll
View header-scroll.js
var scroll_start = 0;
var startchange = $('#scroll-color');
var offset = startchange.offset();
$(document).scroll(function () {
scroll_start = $(this).scrollTop();
if (scroll_start > offset.top) {
$('.navigation').css('background', '#e63c2d');
} else {
$('.navigation').css('background', 'transparent');
}
View example.scss
// Variables
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
@taniarascia
taniarascia / index.css
Created Mar 6, 2020
React Redux Application
View index.css
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
p {
font-size: 1.1rem;
}
View Roadmap.md

Roadmap of Web Development

Getting Started

Operating System

What operating system your computer runs on.

  • Mac, Windows, Linux