Skip to content

Instantly share code, notes, and snippets.

💾

Tania Rascia taniarascia

💾
Block or report user

Report or block taniarascia

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 hex16.js
// echo -en "\x01\x02\x03\x04\x05\x06hello world\x07\x08\x09\x10goodbye world\x11\x12\x13\x14\x15" > data
let fs = require('fs')
let file = process.argv.slice(2)[0]
function hexdump(file) {
let buffer = fs.readFileSync(file)
let lines = []
for (let i = 0; i < buffer.length; i += 16) {
View 16.js
// echo -en "\x01\x02\x03\x04\x05\x06hello world\x07\x08\x09\x10goodbye world\x11\x12\x13\x14\x15" > data
let fs = require('fs')
let file = process.argv.slice(2)[0]
let buffer = fs.readFileSync(file)
let lines = []
for (let i = 0; i < buffer.length; i += 16) {
let block = buffer.slice(i, i + 16)
@taniarascia
taniarascia / hexdump.js
Last active Jan 4, 2019
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 read.js
// echo -en "\x01\x02\x03hello" > data
// node read.js data
let fs = require('fs')
let file = process.argv.slice(2)[0]
let buffer = fs.readFileSync(file)
for (let value of buffer) {
let decimal = value
let hex = value.toString(16)
View keybase.md

Keybase proof

I hereby claim:

  • I am taniarascia on github.
  • I am taniarascia (https://keybase.io/taniarascia) on keybase.
  • I have a public key whose fingerprint is 2389 41F6 BA1D 7BE2 119E 973D 8345 A0A6 86E5 7E04

To claim this, I am signing this object:

@taniarascia
taniarascia / listAllEventListeners.js
Created Oct 23, 2018 — forked from dmnsgn/listAllEventListeners.js
List all event listeners in a document
View listAllEventListeners.js
const listeners = (function listAllEventListeners() {
let elements = [];
const allElements = document.querySelectorAll('*');
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
for (let i = 0; i < allElements.length; i++) {
const currentElement = allElements[i];
View reactrouter.js
import React, { Component } from 'react'
import { NavLink, Switch, Route } from 'react-router-dom'
import './App.css'
const Navigation = () => (
<nav>
<ul>
<li>
<NavLink exact activeClassName="current" to="/">Home</NavLink>
</li>
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 {}
View roadmap.md

Roadmap of Web Development

Getting Started

Operating System

What operating system your computer runs on.

  • Mac, Windows, Linux
View pandoc.md

Pandoc Resources

brew instal pandoc
mkdir pandocking
cd pandocking
pandoc chapter1.md -s -o chapter1.html

Flags

You can’t perform that action at this time.