Skip to content

Instantly share code, notes, and snippets.

@antonga23
antonga23 / laravellocal.md
Created May 15, 2020 10:38 — forked from hootlex/laravellocal.md
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci
@antonga23
antonga23 / gist:5657c3bc78ac319be1a1f8acdd070602
Created October 29, 2020 13:57 — forked from c0ldlimit/gist:5164171
#python #flask #pandas Using flask to return a csv response from a dataframe
import StringIO
from flask import Flask, Response
@app.route('/some_dataframe.csv')
def output_dataframe_csv():
output = StringIO.StringIO()
some_dataframe.to_csv(output)
@antonga23
antonga23 / csv_to_flask.py
Created November 10, 2020 10:10 — forked from dasdachs/csv_to_flask.py
Upload, read and save the content of a csv file to your model
#!/usr/bin/env python
from io import TextIOWrapper
import csv
from flask import Flask, request, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
# Create Flaskk app, config the db and load the db object
# http://flask-sqlalchemy.pocoo.org/2.1/quickstart/#a-minimal-application
@antonga23
antonga23 / forwardport.sh
Created November 18, 2020 19:32 — forked from debashisbarman/forwardport.sh
Forward port 80 to 8080 on EC2 instance.
sudo iptables -t nat -L
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
@antonga23
antonga23 / Privilege Escalation.md
Created May 7, 2021 14:52 — forked from A1vinSmith/Privilege Escalation.md
Privilege Escalation: Systemctl (Misconfigured Permissions — sudo/SUID)
@antonga23
antonga23 / FullExample.php
Created June 22, 2021 16:51 — forked from IamSmith/FullExample.php
Fully working example
<?php
require_once("PHPExcel/PHPExcel.php");
$phpExcel = new PHPExcel();
$styleArray = array(
'font' => array(
'bold' => true,
)
);
@antonga23
antonga23 / git.migrate
Created June 23, 2021 15:22 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@antonga23
antonga23 / coinId.php
Created July 1, 2021 11:08 — forked from crcrcr999/coinId.php
XCH(chia) getCoinId by PHP
<?php
function hexToStr($hex){
$string='';
for ($i=0; $i < strlen($hex)-1; $i+=2){
$string .= chr(hexdec($hex[$i].$hex[$i+1]));
}
return $string;
}
function getCoinId($parent_coin_info,$puzzle_hash,$amount){
@antonga23
antonga23 / facebook.py
Created December 31, 2021 10:31 — forked from ezl/facebook.py
Are there any put-call parity opportunities? Lets check facebook options
"""
Checking for put-call parity mispricings in facebook.
fb is American, so put call parity doesn't actually apply, but
this is a short term option, with no dividends between now and the
expiration (apr 17, 1 week option), in a low interest rate environment
so you can expect the trees to act almost european.
easier to find this data on yahoo than actual european data and
everyone knows what facebook is so i went with it.
@antonga23
antonga23 / example.md
Created March 29, 2022 08:42 — forked from devdrops/example.md
Mysqldump from Docker container

Mysqldump from Docker container

docker exec -i mysql_container mysqldump -uroot -proot --databases database_name --skip-comments > /path/to/my/dump.sql

OBS

  • This will generate a dump.sql file in your host machine. Awesome, eh?
  • Avoid using --compact on your dump. This will make MySQL check your constraints which will cause troubles when reading your file (damm you MySQL). And don't use --force to fix this scenario: recreate your dump without --compact ¯_(ツ)_/¯