Skip to content

Instantly share code, notes, and snippets.

<div class="w-full max-w-2xl mx-auto bg-white shadow-lg rounded-sm border border-gray-200">
<header class="px-5 py-4 border-b border-gray-100">
<h2 class="font-semibold text-gray-800">Customers</h2>
</header>
<div class="p-3">
<div class="overflow-x-auto">
<table class="table-auto w-full">
<thead class="text-xs font-semibold uppercase text-gray-400 bg-gray-50">
<tr>
<th class="p-2 whitespace-nowrap">
@nickescobedo
nickescobedo / LookTowardMouse.cs
Last active January 8, 2020 11:54
Unity C# script to have the object look at the mouse.
using UnityEngine;
public class LookTowardMouse : MonoBehaviour
{
void Update ()
{
Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Vector3 perpendicular = Vector3.Cross(transform.position-mousePos,Vector3.forward);
transform.rotation = Quaternion.LookRotation(Vector3.forward, perpendicular);
transform.Rotate(0, 0, -90);
@nickescobedo
nickescobedo / filter.html
Created May 24, 2017 04:32
Simple Vue.js Filtering
<div id="simple-filter">
<input type="text" v-model="searchText" />
<ul>
<li v-for="animal in filteredAnimals">{{ animal }}</li>
</ul>
</div>
@nickescobedo
nickescobedo / FileStorageController.php
Created August 13, 2015 01:33
File Storage Example
<?php
class FileStorageController extends Controller
{
private $fileStorage;
//Laravel will automatically resolve FileStorageInterface to the S3FileStorage class
public function __construct(FileStorageInterface $fileStorage)
{
$this->fileStorage = $fileStorage;
@nickescobedo
nickescobedo / test-exception.php
Created January 11, 2015 21:44
PHP Unit Test Exception
/**
* @expectedException IllegalArgumentException
*/
public function testMethodThrowsException() {
// Code that will throw IllegalArgumentException
}
@nickescobedo
nickescobedo / create-records.sql
Created January 10, 2015 21:33
Query MySQL for records updated in a particular period of time
INSERT INTO users (firstname, lastname, email, updated_at)
VALUES ('Jon', 'Smith', 'jsmith@smith.com', '2014-12-24 12:00:23');
INSERT INTO users (firstname, lastname, email, updated_at)
VALUES ('Jones', 'Smith', 'jsmith@smith.com', '2014-12-25 12:00:23');
INSERT INTO users (firstname, lastname, email, updated_at)
VALUES ('Ed', 'Smith', 'esmith@smith.com', '2014-12-25 12:00:23');
INSERT INTO users (firstname, lastname, email, updated_at)
@nickescobedo
nickescobedo / element.html
Last active August 29, 2015 14:12
Use One JavaScript Function to Slide Any HTML Element
<button onClick="slideUpDown('slide-text')">Slide Paragraph</button>
<div id="slide-text">
<p>Sliding paragraph</p>
</div>
@nickescobedo
nickescobedo / emailBuilder.php
Created January 2, 2015 19:17
Build Email Dynamically From Submitted Form
foreach(array_keys($_POST) as $key){
//Strips all underscores from url and replaces them with spaces.
//This is because it uses the name field for the email labels
$keywos = str_replace("_", " ", $key);
$values[$key] = $_POST[$key];
if(trim($values[$key]) != ""){
if( $key != "submit")
$message .= $keywos . ": " . $_POST[$key] . "\r\n";
@nickescobedo
nickescobedo / .gitignore
Created January 2, 2015 19:05
Android Studio .gitignore File
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
<button onClick="slideContent('content1')">Content 1</button>
<button onClick="slideContent('content2')">Content 2</button>
<div id="content1">
<p>Sliding paragraph</p>
</div>
<div id="content2">
<p>Sliding paragraph</p>
</div>