Skip to content

Instantly share code, notes, and snippets.

@phplaw
phplaw / link_and_bugs.md
Last active November 10, 2023 08:48
Everything about eGPU on Mac
<!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" />
// 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) {
@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"
@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 / 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 / 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 / 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 / Node.JS
Last active June 5, 2019 07:59
Paypal Intergrate
// return_url
// credit_card || paypal
//approval_url
// paymentId
// https://github.com/paypal/paypal-checkout/blob/master/docs/button.md
// Build PayPal payment request
// DEFINE PAYPMENT DATA
var payReq = JSON.stringify({
intent:'sale',
payer:{
@phplaw
phplaw / commands.sh
Last active October 21, 2019 09:33
All about docker
# List all containers (only IDs)
docker ps -aq
# Stop all running containers
docker stop $(docker ps -aq)
# Remove all containers, maybe we need -f| --force option for force delete running container
docker rm $(docker ps -aq)
# Remove all images