Skip to content

Instantly share code, notes, and snippets.

View eddiejhong's full-sized avatar

Eddie Hong eddiejhong

  • Seattle
View GitHub Profile
@eddiejhong
eddiejhong / api-response.json
Created April 25, 2022 23:09
api-response.json
{
"status": "success",
"data": {
"ids": [
{
"id": 99999,
"symbol": "ETH"
},
{
"id": 1,
@eddiejhong
eddiejhong / toilet.js
Created October 7, 2015 17:29
toilet
function getRandomStartingSeatConfiguration() {
var seatRandomMod = 2,
seatRandomNum = Math.floor(Math.random()*seatRandomMod);
if(seatRandomNum%seatRandomMod) {
return 'up';
} else {
return 'down';
}
}
@eddiejhong
eddiejhong / popup_text
Last active December 19, 2015 16:49
This is useful in creating popup text when mousing over an element on a page. Only one line of html is required!
$('body').on({
mouseenter: function(e) { //the argument 'e' allows for the use of position tracking
$('#popup_text').css({ //using the position of the current target (element which is moused over), we can position the popup text using CSS
left: $(this).offset().left-130,
top: $(this).offset().top-5
});
},
mouseleave: function(e) { //once the mouse has left the target element, the CSS moves the popup text out of view
$('#popup_text').css({
left: -9999,
@eddiejhong
eddiejhong / overlay-style.css
Last active December 18, 2015 19:29
In order to overlay text or images without creating whitespace, the text/images to be overlayed must be contained in a wrapper that has a defined height.
//For example
.school-directory-container{
height: 250px;
}
.school-directory-copy{
position:relative;
top:-242px;
font-size: 144%;
width: 253px;
@eddiejhong
eddiejhong / wordpress includes
Created June 20, 2013 21:35
How to include files in the wordpress directory without absolute paths. *Pathing should be delegated to the code. Use get_template_directory() to dynamically get the path to the template.
<?php
$path = get_template_directory();
include($path."/example.php");
?>
UPDATE popular_crosslinks
SET slug = NULL;
UPDATE popular_crosslinks
SET slug = CONCAT("/", LOWER(degree_level_proper))
WHERE degree_level IS NOT NULL;
UPDATE
-- SELECT slug,search_term_url FROM
popular_crosslinks