Skip to content

Instantly share code, notes, and snippets.

View raphaelnikson's full-sized avatar

Raphael Nikson raphaelnikson

View GitHub Profile
@raphaelnikson
raphaelnikson / RouteChangeStart.js
Created May 23, 2019 13:28 — forked from pablodenadai/RouteChangeStart.js
AngularJS: On route change start - Check if user has permission to proceed or redirect it to the Sign In page.
app.run(function ($rootScope, $location, AuthenticationModel) {
// Register listener to watch route changes.
$rootScope.$on('$routeChangeStart', function (event, next, current) {
if (!AuthenticationModel.isSignedIn() && next.requireAuthentication === true) {
$location.path('/signin');
}
});
});
@raphaelnikson
raphaelnikson / android-generate-keystores.md
Created May 16, 2019 13:32 — forked from henriquemenezes/android-generate-keystores.md
Android: Generate Release/Debug Keystores

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"
<?php
$teste = new WP_User(3);
$key = get_password_reset_key($teste);
print_r(check_password_reset_key($key, 'userlogin'));
?>
@raphaelnikson
raphaelnikson / menu-submenu.php
Created July 9, 2018 18:03
Menu e Submenu WordPress
add_action('admin_menu', 'wp_users_roles_menu');
function wp_users_roles_menu() {
add_submenu_page(
'users.php',
'Tipos de Usuários',
'Tipos de Usuários',
'manage_options',
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@raphaelnikson
raphaelnikson / cpf.php
Created July 6, 2017 00:12 — forked from felipemarcos/wp-cpf-login.php
Permitir login por CPF - WordPress
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Login
*/
class Custom_CPF_Login {
@raphaelnikson
raphaelnikson / meta-tags.md
Created June 30, 2017 15:08 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@raphaelnikson
raphaelnikson / filters-in-the-wp-rest-api-v2
Created May 24, 2017 02:22 — forked from BraadMartin/filters-in-the-wp-rest-api-v2
A list of all of the filters available in the WP REST API v2
rest_avatar_sizes
rest_prepare_attachment
rest_pre_insert_comment
rest_comment_type_trashable
comment_text
@raphaelnikson
raphaelnikson / wave
Created May 20, 2017 16:14 — forked from naveenshaji/wave
Material Design Wave effect CSS
.waves-effect {
position: relative;
cursor: pointer;
display: inline-block;
overflow: hidden;
user-select: none;
transition: all 0.3s ease-out;
}
.waves-effect .waves-ripple {
position: absolute;
@raphaelnikson
raphaelnikson / PHP
Created March 1, 2017 16:29
Adicionar texto ao metabox
add_action('admin_footer', 'funcao_texto' );
function funcao_texto(){
?>
<script>
jQuery(document).ready(function(){
jQuery(document).find('#postbox-container-1 .inside').append('Texto aqui');
});
</script>
<?php
}