Skip to content

Instantly share code, notes, and snippets.

View pedropapa's full-sized avatar
🏠
Working from home

Pedro Papadopolis pedropapa

🏠
Working from home
  • Sydney, Australia
View GitHub Profile
@pedropapa
pedropapa / finddomains.js
Created December 22, 2015 12:33
Pesquisa domínios com 3 letras disponíveis no registro.br
// Deve ser executado no site www.registro.br
var $http = angular.element(document.body).injector().get('$http');
function verificar() {
var domain = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 3) + '.com.br';
$http.get("/cgi-bin/avail/?qr="+domain).success(function(data){
if(data.available) {
console.log(domain + ' está disponível para registro');
}
});
<html>
<body>
<script type="text/javascript">
var screenWidth = window.innerWidth;
var screenHeight = window.innerHeight;
var floor = screenHeight * 0.8;
with(document.body.style) {
height = screenHeight + 'px';
detectCollisions: function(particle) {
var particles = document.getElementsByClassName('particle');
var particleWidth = particle.clientWidth;
var particleHeight = particle.clientHeight;
var particleTop = parseInt(particle.style.top);
var particleLeft = parseInt(particle.style.left);
var particleBottomLeftNodeX = particleLeft;
var particleBottomLeftNodeY = particleTop + particleHeight;
@pedropapa
pedropapa / gist:a7438ff7a7966deb7be1
Created November 25, 2014 18:39
Buscar jogadores e servidores online no SA-MP
<?php
function Request($a, $b, $c, $d, $e) {
$ch = curl_init();
$exec = curl_setopt_array($ch, array(
CURLOPT_URL => $a,
CURLOPT_RETURNTRANSFER => $b,
CURLOPT_HEADER => 1,
CURLOPT_NOBODY => 0,
CURLOPT_COOKIE => $c,
#include <a_samp>
#include <Dini>
#include <a_http>
#include <a_mysql>
/**
* --------------- Sistema para procurar e ouvir rádios do ShoutCast In-Game ---------------
*
* @author: Pedro P. L. Papadópolis (a.k.a Mandrakke).
* @copyright: Não há.
@pedropapa
pedropapa / RaR: php explode()
Last active August 29, 2015 14:05
Função explode
<?php
/*
"recriando a roda", função explode()
By: Papadópolis (@papadopolis)
*/
function _explode($op,$str,$lim = null) {
$output = array();
preg_match_all("/(.*?$op|.*?$)/i",$str,$vals);