Skip to content

Instantly share code, notes, and snippets.

@phplaw
phplaw / theme.php
Last active January 14, 2019 16:03
WordPress Development Tips & Tricks
<?php
// https://developer.wordpress.org/themes/template-files-section/page-template-files/
// https://www.imagely.com/wordpress-gallery-plugin/ => Beautiful Theme
@phplaw
phplaw / get_closest_locations.js
Created March 16, 2019 20:16
JavaScript Geo Location
// Get User's Coordinate from their Browser
window.onload = function() {
// HTML5/W3C Geolocation
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(UserLocation);
}
// Default to Washington, DC
else
NearestCity(38.8951, -77.0367);
}
@phplaw
phplaw / ng.js
Created March 3, 2020 04:57
AngularJS Tips & Tricks
$scope.foo = function($event, team) {
var $btn = $($event.currentTarget);
}
//html
/* <button type="button" ng-click="foo($event, team)">Edit</button> */
@phplaw
phplaw / Activate Office 2019 for macOS VoL.md
Created March 29, 2020 22:07 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@phplaw
phplaw / killadobe.sh
Created March 30, 2020 15:09 — forked from CyberPunkCodes/killadobe.sh
Mac Bash script to kill Adobe Create Cloud and other processes that Adobe forces on us.
#!/bin/bash
echo "\n\n--- Killing Stupid Adobe Auto Load Crap ---\n\n"
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
launchctl unload -w /Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist
echo "\n\n--- Done! ---\n\n"
// pretty log object
var x = [{a:1}, {a:2}, {a:3}];
var log = console.log;
log(x.unshift({a:4}, {a:5}));
log(JSON.stringify(x, null, 2));
// to mysql datetime format
function twoDigits(d) {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" type="text/css" />
@phplaw
phplaw / link_and_bugs.md
Last active November 10, 2023 08:48
Everything about eGPU on Mac