Skip to content

Instantly share code, notes, and snippets.

View matheuseduardo's full-sized avatar
:octocat:
coding

Matheus Eduardo Silva Guimarães matheuseduardo

:octocat:
coding
View GitHub Profile
@matheuseduardo
matheuseduardo / teambets.sp
Last active July 13, 2021 18:37
teambets.sp - v2.7.2 (Source + CSGO?)
/**
* teambets.sp
* Adds team betting. After dying, a player can bet on which team will win.
*/
#include <sourcemod>
#pragma semicolon 1
#define PLUGIN_VERSION "2.7.2"
public Plugin:myinfo =
{
name = "Team Bets",
PASTAINICIO=$(pwd);
PATHHEADER="$PASTAINICIO/.header"
if (test -r $PATHHEADER)
then
cat $PATHHEADER;
fi
@matheuseduardo
matheuseduardo / DCIM-sizes.sh
Created January 22, 2019 12:47
shell script to list sizes of pics & vids
anos=`seq 2016 2018`; # 2016 a 2018
meses=`seq -w 1 12`; # todos os meses
for ano in $anos
do
for mes in $meses
do
data=$ano$mes;
tam=`du -c DCIM/**/IMG_$data*.jpg DCIM/**/VID_$data*.mp4 2> /dev/null | tail -1 | cut -f 1`
echo $data: $tam
##Test
Exclude
##Books
Chrome
Movies
Music
##PlayGames
Talkback
@matheuseduardo
matheuseduardo / .gitalias
Last active May 3, 2021 12:42
alias para o git
alias.lg log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
alias.lg2 log --pretty='%h - %s (%an)'
alias.alias config --get-regexp ^alias\.
alias.unadd reset HEAD --
alias.unstage reset HEAD --
@matheuseduardo
matheuseduardo / example.md
Last active August 30, 2018 18:11
subir arquivo para WebDAV via shell
@matheuseduardo
matheuseduardo / GetrsSetrs.class.php
Created August 21, 2018 18:17
class with getters and setters predefined through magic methods
<?php
class GetrsSetrs {
public function __call($name, $arguments) {
$action = substr($name, 0, 3);
if ($action == 'get') {
return $this->get(lcfirst(substr($name, 3)));
}
else if ($action == 'set') {
@matheuseduardo
matheuseduardo / Db.class.php
Created August 8, 2018 02:40
classe simples de DB
<?php
class DB {
/**
* @var DB
*/
private static $instancia = NULL;
/**
* @var Mysql link identifier
@matheuseduardo
matheuseduardo / create-preview-from-video.sh
Created July 18, 2018 16:04
Create Short Preview from Video
# source: https://davidwalsh.name/video-preview
# sample in PHP => https://gist.github.com/AkgunFatih/88c2241865c25e40a50edc4e24679a94
sourcefile=$1
destfile=$2
# Overly simple validation
if [ ! -e "$sourcefile" ]; then
echo 'Please provide an existing input file.'
@matheuseduardo
matheuseduardo / base64.inc.asp
Created July 12, 2018 18:50
Base64 encoding / decoding functions in VbScript / Classic ASP
<%
Function Base64Encode(sText)
Dim oXML, oNode
Set oXML = CreateObject("Msxml2.DOMDocument.3.0")
Set oNode = oXML.CreateElement("base64")
oNode.dataType = "bin.base64"
oNode.nodeTypedValue = Stream_StringToBinary(sText)
Base64Encode = oNode.text
Set oNode = Nothing
Set oXML = Nothing