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"
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 / gravity-forms-notification-popup.css
Created December 2, 2016 08:53 — forked from anythinggraphic/gravity-forms-notification-popup-keep-form.php
Gravity Forms Notification Popup (Genesis Framework)
#overlay {
background: #000;
background: rgba(0, 0, 0, 0.3);
display: block;
float: left;
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
@raphaelnikson
raphaelnikson / dropzonejs-wp-rest-api.js
Created July 20, 2016 01:20 — forked from soderlind/dropzonejs-wp-rest-api.js
DropzoneJS & WordPress REST API
/*
Uploading images is a two step process (from https://github.com/WP-API/WP-API/issues/1768#issuecomment-160540932):
POST the data to /wp/v2/media - this can either be as the request body, or in multipart format. This will upload the file, and give you a 201 Created response with a Location header. This header points to the post object for the attachment that has just been created.
PUT the post data to the endpoint returned in the Location header (which will look something like /wp/v2/media/{id}).
I do step 2 (PUT), if POST is a success, in myDropzone.on("success", function(file, response){}
*/
// dropzoneWordpressRestApiForm is the configuration for the element that has an id attribute
@raphaelnikson
raphaelnikson / CreateWordpressUser.php
Created July 19, 2016 15:33 — forked from jawinn/CreateWordpressUser.php
Create WordPress Admin User from PHP
<?php
// ADD NEW ADMIN USER TO WORDPRESS
// ----------------------------------
// Put this file in your Wordpress root directory and run it from your browser.
// Delete it when you're done.
require_once('wp-blog-header.php');
require_once('wp-includes/registration.php');
// ----------------------------------------------------