Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I truly want a overseas opportunity.

Daniel Reis DanielHe4rt

💭
I truly want a overseas opportunity.
View GitHub Profile
@DanielHe4rt
DanielHe4rt / bot.php
Created Sep 15, 2021
Zup Twitter Bot
View bot.php
<?php
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();
$tweetId = $argv[1];
$uri = 'https://twitter.com/i/api/graphql/MFRcu86F8zXkX7810z6sGA/Retweeters?variables=%7B%22tweetId%22%3A%22' . $tweetId . '%22%2C%22count%22%3A80%2C%22withTweetQuoteCount%22%3Afalse%2C%22includePromotedContent%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Afalse%2C%22withUserResults%22%3Atrue%2C%22withBirdwatchPivots%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Afalse%7D';
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@DanielHe4rt
DanielHe4rt / dock.sh
Created Jul 12, 2021
Dock Sensacional danielhe4rt atualizada 2021
View dock.sh
#!/bin/bash
# só rodar esses 3 comandos no terminal e ser feliz
# atualização bombastica 2021 pode confiar
gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed false
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM
@DanielHe4rt
DanielHe4rt / bashrc
Created Jun 11, 2021
Bash base config
View bashrc
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
else
echo ""
fi
View cotty.php
<?php
$db1 = new PDO('mysql:host=localhost;dbname=insertbooking', 'root', '', array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
$db1->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db1->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_EMPTY_STRING);
$db2 = new PDO('mysql:host=localhost;dbname=testdb', 'root', '', array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
$db2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db2->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_EMPTY_STRING);
@DanielHe4rt
DanielHe4rt / bagisto.md
Last active May 18, 2021
Bagisto Concepts
View bagisto.md

Seguinte mano tudo que tiver aqui é só um toque pra quando eu precisar fazer setup novamente no CMS da Bagisto

  • php artisan cache:clear
  • php artisan route:clear

No .env ele auto preenche como http://lalala.com/admin, porém deve ser apenas /admin O core da aplicação fica dentro da pasta packages Há vários tutoriais de como criar um novo pacote pra CMS, use essa informação quando for criar uma integração.

@DanielHe4rt
DanielHe4rt / FileUploader.php
Created May 8, 2021
Uploader de Arquivos em PHP
View FileUploader.php
<?php
session_start();
class FileUploader {
private $file;
private $mimesAllowed = [];
public function upload($file, string $directory = '') {
@DanielHe4rt
DanielHe4rt / fodase-oo.php
Created May 6, 2021
Ensinando OO a base do fodase Rev 123123123
View fodase-oo.php
<?php
class Fodase {
public static function vaiCaralho() {
echo "vai caralho";
}
}
Fodase::vaiCaralho();
@DanielHe4rt
DanielHe4rt / Bot.java
Created Apr 23, 2021
CleitinBot - Twitch Integrated Chat Bot
View Bot.java
/**
* CleitinBot - O bot mais arrombado da Twitch (dependendo de onde vc conectar ele)
*
* Para que você possa usar, gere um token de usuário no link abaixo e
* troque o token na parte de conexão.
*
* Link: https://twitchapps.com/tmi/
*
* Ao trocar, use a função JOIN para conectar no canal predefinido e fique brincando
@DanielHe4rt
DanielHe4rt / Chess.php
Created Mar 5, 2021
FakeChess - Uma representação MUITO RUIM de xadrez pois eu n sei jogar
View Chess.php
<?php
/**
* FakeChess - Xadrez de cadeia
*
* @author danielhe4rt
* @author merlinhohe4rt
*/
declare(strict_types=1);