Skip to content

Instantly share code, notes, and snippets.

:octocat:

Josafá Filho josafafilho

:octocat:
Block or report user

Report or block josafafilho

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@josafafilho
josafafilho / gist:a2d5ff17c2c4228d5115
Created Jul 19, 2015
ReactiveCocoa Swift Extension
View gist:a2d5ff17c2c4228d5115
// ReactiveCocoaExtension.swift
//
// Simple ReactiveCocoa Swift extensions using generics
// Created by josafafilho<josafafilho15@gmail.com> on 7/19/15.
import Foundation
import ReactiveCocoa
extension RACSignal {
func subscribeNextAs<T>(nextClosure:(T) -> ()) -> () {
@josafafilho
josafafilho / gridsearch.php
Last active Aug 29, 2015
The Grid Search HackerRank Solution using PHP
View gridsearch.php
<?php
function gridSearch($big,$small){
$firstMatch = null;
foreach($big as $key => $bigLine){
$position = strpos($bigLine,$small[0]);
if ($position!==false){
$firstMatch = [$key,$position];
break;
}
@josafafilho
josafafilho / wp_really_get_current_post_type.php
Created Sep 2, 2015
Really get the current post type on Wordpress Admin
View wp_really_get_current_post_type.php
/**
* gets the current post type in the WordPress Admin
*/
public function get_current_post_type()
{
global $post, $typenow, $current_screen;
//we have a post so we can just get the post type from that
if ($post && $post->post_type)
return $post->post_type;
View visitor.php
<?php
/**
* Classes criadas com base no plugin Comment Popularity
* @link https://github.com/humanmade/comment-popularity/
*/
/**
* Class WP_Side_Comments_Visitor
*/
View last-comments-success.json
{
"success":true,
"data":[
{
"section_id":"6",
"section_text":"II - os dados pessoais objeto do tratamento tenham sido coletados no territ\u00f3rio nacional.",
"comments":[
{
"author":"Pensando o Direito",
"comment_text":"teste",
View last-comments-error.json
{
"success":false,
"data":{
"error_message":"Nenhum coment\u00e1rio encontrado"
}
}
View texto-em-debate.css
.highlight {
background-color: yellow
}
.highlight.current {
background-color: orange;
}
View paragrafo.html
<p id="commentable-section-1" class="commentable-section" data-section-id="1">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec arcu leo, laoreet in tempus sed, malesuada lacinia tortor. Curabitur ipsum elit, elementum non nunc nec, blandit posuere augue. Fusce eu neque sem. Morbi nisi velit, elementum a hendrerit rhoncus, viverra sed ipsum. Suspendisse sit amet dignissim arcu, eget cursus arcu. Donec sed malesuada nulla. Donec eget pretium enim. Curabitur a semper nunc. Nunc vel augue eu elit lacinia luctus. Curabitur ut pulvinar purus. Duis ultricies fermentum elit, nec aliquet libero mattis eget. Sed efficitur est eros, nec elementum ex posuere sed. Suspendisse turpis lacus, pellentesque a tempor nec, ultrices vel erat. In sed feugiat felis. In et varius sapien, et semper arcu.<div class="side-comment has-comments no-current-user">
<a href="#" class="marker">
<span>7</span>
</a>
<div class="comments-wrapper">
<div class="comments-header clearfix">
<div class="pull-left">
<h5 class=
@josafafilho
josafafilho / dadospessoais-hack.css
Created Oct 8, 2015
Hack CSS para Tema Dados Pessoais e WP Side Comments
View dadospessoais-hack.css
p.commentable-section.active {
width: 100%
}
.commentable-section.active:after {
display: none
}
.side-comment.active {
position: relative;
width: 100%;
left: 0;
You can’t perform that action at this time.