Skip to content

Instantly share code, notes, and snippets.

View willguesser's full-sized avatar

William Guesser willguesser

  • Era Conectada
  • Florianópolis
View GitHub Profile
@willguesser
willguesser / restrict_doc_creation.php
Created June 19, 2018 17:58 — forked from dcavins/restrict_doc_creation.php
Only allow certain users to create docs.
<?php
add_filter( 'bp_docs_map_meta_caps', function( $caps, $cap, $user_id, $args ) {
if ( 'bp_docs_create' === $cap ) {
// Site admins
if ( user_can( $user_id, 'bp_moderate' ) ) {
$caps = array( 'exist' );
// If this is a group and the user is a group mod or admin.
} else if ( bp_is_group() && ( bp_group_is_mod() || bp_group_is_admin() ) ) {
$caps = array( 'exist' );
} else {
@willguesser
willguesser / gist:640efa1d44660e20256814993140b2fd
Created April 25, 2018 02:50 — forked from rolandinsh/gist:5636349
wp_new_user_notification() - wordpress new user notification message on register
<?php
if ( !function_exists( 'wp_new_user_notification' ) ) {
function wp_new_user_notification( $studentID, $plaintext_pass = '' ) {
$student = new WP_User($studentID);
$student_data = get_userdata( $studentID );
$firstname = $student_data->first_name;
$student_login = stripslashes( $student_data->user_login );
// URLs
$site_url = site_url();
@willguesser
willguesser / stargatePortal.css
Created March 4, 2018 07:09
Stargate Portal - Animação em CSS de um portal de plasma
.bg {
background: #111 url('https://res.cloudinary.com/shanomurphy/image/upload/v1519972582/stargate_yjqmmj.jpg') no-repeat center;
background-size: cover;
width: 177vh;
height: 100vh;
margin: 0 auto;
position: relative;
}
.portal {
@willguesser
willguesser / planetGalery.css
Created March 4, 2018 07:05
Planet Galery - Galeria de planetas
//Best on mobile
@import url('https://fonts.googleapis.com/css?family=Montserrat:300,400,500');
*{
box-sizing: border-box;
margin: 0;
}
html, body{
@willguesser
willguesser / cornerRibon.css
Created March 4, 2018 06:49
Pure CSS corner ribbon - Fita lateral de canto em CSS puro.
@import url(https://fonts.googleapis.com/css?family=Lato:700);
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #f0f0f0;
}
.box {
position: relative;