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
@taniarascia
taniarascia / index.html
Last active Nov 21, 2019
HTML Skeleton file
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="author" content="">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
@taniarascia
taniarascia / nav.html
Last active Nov 6, 2019
Responsive Dropdown Navigation Bar
View nav.html
<section class="navigation">
<div class="nav-container">
<div class="brand">
<a href="#!">Logo</a>
</div>
<nav>
<div class="nav-mobile">
<a id="nav-toggle" href="#!"><span></span></a>
</div>
<ul class="nav-list">
@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 / index.php
Created Oct 18, 2015
Start Wordpress Tutorial
View index.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
@taniarascia
taniarascia / fakeNotes.json
Last active Sep 28, 2019
fake initial state test
View fakeNotes.json
[
{
"id":"shfksjh32hrkwefhkj3h",
"text":"# Example default note\n\n- [Laconia](https://laconia.dev)\n- [Chip8.js](https://github.com/taniarascia/chip8",
"created":"",
"lastUpdated":""
},
{
"id":"893hfehfkjshkj233",
"text":"# Another something else\n\nEveryone loves notes",
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 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) {
@taniarascia
taniarascia / functions.php
Last active Aug 27, 2019
Inlcuding custom fields and uploads in a WordPress post
View functions.php
<?php
function create_post_your_post() {
register_post_type( 'your_post',
array(
'labels' => array(
'name' => __( 'Your Post' ),
),
'public' => true,
'hierarchical' => true,
View wp-config-sample.php
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
@taniarascia
taniarascia / page.php
Created Aug 10, 2016
Displaying all the output from your custom meta box
View page.php
<?php get_header(); ?>
<?php
$args = array(
'post_type' => 'your_post',
);
$your_loop = new WP_Query( $args ); if ( $your_loop->have_posts() ) : while ( $your_loop->have_posts() ) : $your_loop->the_post();
$meta = get_post_meta( $post->ID, 'your_fields', true ); ?>
You can’t perform that action at this time.