Skip to content

Instantly share code, notes, and snippets.

View ezetojo's full-sized avatar

Ezequiel Tojo ezetojo

View GitHub Profile
@ezetojo
ezetojo / unlike.js
Created July 7, 2023 02:33
Unlike twitter
function dislike(){
document.querySelector('[data-testid="unlike"]').scrollIntoView()
document.querySelector('[data-testid="unlike"]').click()
}
const start = setInterval(dislike,1000)
@ezetojo
ezetojo / README.md
Created July 6, 2023 20:50 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@ezetojo
ezetojo / delete-likes-from-twitter.md
Created July 5, 2023 19:40 — forked from aymericbeaumet/delete-likes-from-twitter.md
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@ezetojo
ezetojo / script.js
Created February 19, 2022 17:21
Multiple inputs for image upload placeholder with preview
let filePickers = document.getElementsByClassName("file-picker");
if(filePickers){
for(let i = 0; i < filePickers.length; i++){
filePickers[i].addEventListener("change", function () {
getImgData(filePickers[i]);
});
}
}
@ezetojo
ezetojo / upload_valid.php
Last active September 20, 2020 02:24
php file mime type validation before upload
<?php
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$fileMime = finfo_file($finfo, $file["tmp_name"]);
finfo_close($finfo);
if($fileMime === "image/jpeg" || $fileMime === "image/png"){
// upload
}else{
echo "Wrong file format";
<?php
/**
* Get basedir
*/
function basedir( $docroot = '/' )
{
$docroot = rtrim($docroot, '/\\').DIRECTORY_SEPARATOR;
$basedir = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
if (isset($_SERVER['PATH_INFO'])) {
git init
git add .
git commit -m "first commit"
git remote add origin https://github.com/***/***.git
git push -u origin master
@ezetojo
ezetojo / class-walker-nav-menu.php
Created February 10, 2020 06:41
Tailwind Navigation Implementation for Wordpress
<?php
/**
* Nav Menu API: Walker_Nav_Menu class
*
* @package WordPress
* @subpackage Nav_Menus
* @since 4.6.0
*/
/**
@ezetojo
ezetojo / app.js
Created June 3, 2018 00:13
AngularJS Agenda (Contact List Alphabetically Ordered and Separated by First Letter)
angular
.module("app", [])
.controller("appCtrl", function ($scope) {
$scope.contacts = [{"name": "John"},{"name": "Ben"},{"name": "Hal"},{"name": "Mimi"},{"name": "Simone"},{"name": "Harry"},{"name": "Brooke"},{"name": "Kirsten"},{"name": "Maureen"},{"name": "Annabel"},{"name": "Rian"},{"name": "Melody"},{"name": "Lucy"},{"name": "Ross"}];
$scope.alpabeth = [];
angular.forEach($scope.contacts, function (cv, ck) {
if ($scope.alpabeth.indexOf(cv.name.charAt(0)) == -1) {