This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Save custom post data meta box | |
* | |
* @access function | |
* @param int | |
* @return void | |
*/ | |
function save_post($post_id) { | |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return; | |
if (!wp_verify_nonce( $_POST['my_noncename'], MY_PLUGIN_DIRECTORY)) return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list files in directory including hidden | |
ls -f | |
# Remove all files and directories (recursive removal) | |
rm -rf /tmp/foo | |
# copy the contents of file to clipboard (location: ~/.ssh/id_rsa.pub) | |
cat ~/.ssh/id_rsa.pub | pbcopy | |
# add public key to fortrabbit server (remove all new lines) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert an array into an object | |
$object = json_decode(json_encode($array), FALSE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const { | |
Mixin | |
} = Ember; | |
/* | |
* This mixin will prevent an authorised user from | |
* accessing any route that does not allow their role | |
* | |
* Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName:'form', | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Route from '@ember/routing/route'; | |
import { action } from '@ember/object'; | |
export default class FormRoute extends Route { | |
@action | |
willTransition(transition) { | |
if (this.controller.userHasEnteredData && | |
!confirm('Are you sure you want to abandon progress?')) { | |
transition.abort(); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import {action} from '@ember/object'; | |
import {tracked} from '@glimmer/tracking'; | |
export default class FormController extends Controller { | |
// Tracking | |
@tracked showExitModal = false; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@layer utilities { | |
/* extra helper classes to account for mobile safe areas */ | |
.p-safe { | |
padding: env(safe-area-inset-top) env(safe-area-inset-right) | |
env(safe-area-inset-bottom) env(safe-area-inset-left); | |
} | |
.px-safe { | |
padding-left: env(safe-area-inset-left); | |
padding-right: env(safe-area-inset-right); |
OlderNewer