Skip to content

Instantly share code, notes, and snippets.

Marcelo de Andrade marcelodeandrade

Block or report user

Report or block marcelodeandrade

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
marcelodeandrade /
Last active Jul 26, 2019
Backup n' Restore MySQL on Docker
# Backup
docker exec -i DOCKER_CONTAINER_ID /usr/bin/mysql --user=root --password=root -h DATABASE > backup.sql
# Restore
docker exec -i DOCKER_CONTAINER_ID /usr/bin/mysql --user=root --password=root -h < backup.sql
docker exec -i $(docker ps -qf "name=superlogica-mysql") /usr/bin/mysql --user=root --password=root -h < backup.sql
View response.php
header('Content-Type: application/json');
header('HTTP/1.1 401 Unauthorized');
$data = [
'status' => 401,
'message' => '401 Unauthorized'
marcelodeandrade / typeValue.asp
Last active Nov 13, 2018
Convert value by recordset value type
View typeValue.asp
public function typeValue(value)
select case TypeName(value)
case "Byte": typeValue = cBool(value)
case "Integer": typeValue = cInt(value)
case "Long": typeValue = cLng(value)
case "Single": typeValue = cDbl(value)
case "Double": typeValue = cDbl(value)
case "Currency": typeValue = cDbl(value)
case "Decimal": typeValue = cDbl(value)
case "Date": typeValue = cDate(value)
marcelodeandrade / dynamic_get_set.asp
Last active Nov 8, 2018
Dynamic get/set properties
View dynamic_get_set.asp
class teste
private abc
private def
private sub class_initialize
end sub
# Credits to @marcelmfs in
# Containers
docker rm -f $(docker ps -a -q)
# Images
docker rmi -f $(docker images -a -q)
# Volumes
docker volume rm $(docker volume ls -q)
View truncate_table_with_fks.sql
DELETE FROM database.dbo.table
DBCC CHECKIDENT ('database.dbo.table', RESEED, 0)
marcelodeandrade /
Created Aug 31, 2018 — forked from jeffersonmartin/
Generate a GitHub Personal Access Token for Private Composer Packages

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit

  2. Click Generate new token.

# see
git config --global push.default current
marcelodeandrade / search_in_sys_objects.sql
Created Jul 17, 2018
Search in SQL Server [sys.objects]
View search_in_sys_objects.sql
type AS object_type,
type_desc AS object_type_desc,
SCHEMA_NAME(schema_id) AS schema_name,
name AS object_name,
OBJECT_DEFINITION(object_id) AS object_source
FROM sys.objects
WHERE OBJECT_DEFINITION(object_id) LIKE '%search_string%'
type_desc LIKE '%VIEW%'
marcelodeandrade / object_types.MD
Last active Jul 17, 2018
SQL SERVER object types
View object_types.MD
type type_desc
AF Aggregate function (CLR)
C CHECK constraint
D Default or DEFAULT constraint
F FOREIGN KEY constraint
FN Scalar function
FS Assembly (CLR) scalar-function
FT Assembly (CLR) table-valued function
IF In-lined table-function
You can’t perform that action at this time.