Install Package Control for easy package management.
- Open the console with
Ctrl+`
- Paste in the following:
// Check if fields are blank | |
$.fn.isFilled = function () { | |
var fields = $(this).serializeArray(); | |
for (var i = 0; i < fields.length; i++) { | |
if (fields[i].value == '') { | |
return false; | |
} | |
} | |
return true; |
#!/usr/bin/env bash | |
echo "Are you on Mac? [y,n]" | |
read input | |
if [[ $input == "Y" || $input == "y" ]]; then | |
## Show active interfaces | |
ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active' | |
## Ask which interface to spoof | |
echo "Which interface are you spoofing?" | |
read interface |
/** | |
* Create popup function that takes url as input | |
* @param url | |
*/ | |
function homescreenPopup(url) { | |
// Add popup container to top of body | |
$('body') | |
.prepend('<div class="homescreen-popup" style="background-image:url(' + url + ');"><div class="close-homescreen-popup">X</div></div>'); | |
// Add click handler to remove popup |
// This is the usual approach to creating functions in JS | |
var waitingList = []; | |
var buttons = document.querySelectorAll("button"); | |
var input = document.querySelector("input"); | |
var waitingListContainer = document.getElementById("waiting-list"); | |
function addPeople(people) { | |
if (Array.isArray(people)) { | |
people.forEach(function(person, index) { | |
waitingList.push(person); |
const ManageWaitingList = { | |
init() { | |
this.waitingList = []; | |
this.buttons = document.querySelectorAll("button"); | |
this.input = document.querySelector("input"); | |
this.waitingListContainer = document.getElementById("waiting-list"); | |
this.bindEvents(); | |
this.onLoad(); | |
}, | |
addPeople(people) { |
// original array | |
var array = [[1,2,[3]],4]; | |
/** | |
* Flatten function for arrays with unlimited depth | |
*/ | |
const flatten = array => { | |
// if input is not array, throw error | |
if (!Array.isArray(array)) throw (new Error('This function can only be used on arrays')); | |
<?php | |
namespace App; | |
/** | |
* Class NavWalker | |
* | |
* Bootstrap 4 walker with cleaner markup for wp_nav_menu() | |
* For use with Sage >= 8.5 | |
* |
Install Package Control for easy package management.
Ctrl+`
<?php | |
/** | |
* Google Geocoding API | |
* | |
* Copyright (C) 2018 Allure Web Solutions <info@allurewebsolutions.com> | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or | |
* (at your option) any later version. |
PID=$(ps -fe | grep "[A]ndroid File Transfer Agent" | awk '{print $2}'); if [[ -n $PID ]]; then kill $PID; fi; mv "/Applications/Android File Transfer.app/Contents/Helpers/Android File Transfer Agent.app" "/Applications/Android File Transfer.app/Contents/Helpers/Android File Transfer Agent DISABLED.app"; mv "${HOME}/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent.app" "${HOME}/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent DISABLED.app"; osascript -e 'tell application "System Events" to delete every login item whose name is "Android File Transfer Agent"' |