Skip to content

Instantly share code, notes, and snippets.

View nguyenDalex's full-sized avatar
🏠
Working from home

Alex Nguyen nguyenDalex

🏠
Working from home
  • American Family Insurance
  • Seattle
View GitHub Profile
@nguyenDalex
nguyenDalex / CSS.css
Last active July 24, 2020 17:52
Kiosk CSS
/* Disable text select */
body{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@nguyenDalex
nguyenDalex / getCardinalDirection
Last active August 29, 2015 14:12
forecast io Cardinal Direction from windbearing javascript funciton
function getCardinalDirection(input) {
var directions = ["N", "NE", "E", "SE", "S", "SW", "W", "NW", "N"];
var index = Math.floor( ((input-22.5)%360) / 45 );
return directions[index+1];
}
@nguyenDalex
nguyenDalex / gist:c5660fc4c048d6f5bd3f
Created December 4, 2014 01:44
set_custom_fields_value() inside of /models/posts.php for ACF
<?php
function set_custom_fields_value() {
global $json_api;
if ($json_api->include_value('custom_fields') && $json_api->query->custom_fields) {
// Query string params for this query var
$params = trim($json_api->query->custom_fields);

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.