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
<form [formGroup]="myForm"> | |
<select formControlName="meal"> | |
<option [value]="'dinoburger-special'">Dinoburger Special</option> | |
<option [value]="'caveman-classic'">Caveman Classic</option> | |
</select> | |
<input type="number" formControlName="quantity"> | |
<div formGroupName="extras"> | |
Pickup: | |
<input type="checkbox" formControlName="pickup"> | |
<select multiple formControlName="sides"> |
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
/** | |
... | |
* Plugin Name: AJ's Amazing Things Plugin | |
* Plugin URI: mysite.com | |
* Description: This plugin does amazing things! Visit the <a href="https://mysite.com/amazing-things/docs" target="_blank">documentation site</a> for usage instructions. | |
... | |
*/ |
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
beforeEach(async(() => { | |
TestBed.configureTestingModule({ | |
imports: [MyComponentModule], | |
providers: [ | |
{ provide: SomeSingletonService, useValue: new SomeSingletonServiceMock() } | |
] | |
}) | |
.overrideComponent(MyCompComponent, { | |
set: { | |
providers: [ |
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
export interface MyFormValues { | |
captcha: number; | |
password: string; | |
username: string; | |
} | |
export interface MyForm extends FormGroup { | |
value: MyFormValues; | |
controls: { | |
captcha: AbstractControl; |
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
public myForm: FormGroup | |
constructor(private formBuilder: FormBuilder) { } | |
ngOnInit() { | |
this.myForm = this.formBuilder.group({ | |
enabledControl: ['hello'], | |
disabledControl: [{ | |
value: 'world', | |
disabled: true |
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
export class LoadAThing { | |
private loadingTheThing = null | |
constructor() {} | |
/** | |
* Triggers a call to retrieve something only once | |
* Subsequent calls will be given the existing promise | |
*/ | |
public loadThingAsync(): Promise<Environment> { | |
// Only attempts the call if it is not currently loading |
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
for old in path/to/files/*.txt; do mv $old path/to/files/`basename $old .text`.md; done |
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
<?php | |
/** | |
* Plugin Name: Change User Language | |
* Description: Change the language depending on the user | |
* Version: 0.1 | |
* Author: AJ Zane | |
* Author URI: http://AJZane.com | |
* License: GPL2 | |
*/ |
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
<?php | |
add_filter('upload_dir', 'mu_media_upload_dir'); | |
function mu_media_upload_dir($upload) { | |
$site_title=str_replace( ' ' , '_' , get_bloginfo('name','raw') ); | |
$upload['path'] = ABSPATH . '/shared/' . $site_title; | |
switch_to_blog(1); | |
$upload['url'] = site_url() . '/shared/' . $site_title; | |
restore_current_blog(); | |
$upload['subdir'] = ""; | |
$upload['basedir'] = $upload['path']; |
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
add_filter( 'all_plugins', 'hide_plugin_list' ); | |
function hide_plugin_list( $plugins ) { | |
if ( is_admin() ) { | |
//Only run this if we're in the Admin panels | |
unset( $plugins[ 'advanced-custom-fields/acf.php'] ); | |
//Admin only plugins | |
if ( ! current_user_can( 'administrator' ) ) { | |
unset( $plugins[ 'better-wp-security/better-wp-security.php'] ); |
NewerOlder