Skip to content

Instantly share code, notes, and snippets.

View cesartalves's full-sized avatar

César t. Alves cesartalves

View GitHub Profile
@ritaly
ritaly / fix_rvm_abort.md
Last active April 19, 2022 15:53
Ruby macOS Catalina: Fixing the abort trap

where: macOS Catalina when: Homebrew’s / rvm after Ruby update to 2.6 or 2.7 fails with abort or Abort trap: 6.
pre: make sure you're using newest rvm version rvm get stable .

All rake and rails command crashed Noticed that rails tasks like rake or rails console, rails db:create, rails db:migrate (info - added only for better googling) these command crashed with the output aborted. No errors only with abord or Abort trap: 6

⚠️ check your local paths!

This is an issue with some OpenSSL libraries. So quick fix:

@ilhamsj
ilhamsj / laravel-notes.md
Last active July 13, 2023 02:08
Force HTTPS laravel on heroku

Force HTTPS laravel on heroku

add this line after RewriteEngine On

RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

app\Http\Middleware\TrustProxies.php

@bradtraversy
bradtraversy / blogscraping.py
Created July 29, 2018 12:02
Simple scraping of a blog
import requests
from bs4 import BeautifulSoup
from csv import writer
response = requests.get('http://codedemos.com/sampleblog/')
soup = BeautifulSoup(response.text, 'html.parser')
posts = soup.find_all(class_='post-preview')
@ksatirli
ksatirli / alternate-bitbucket-pipelines.yml
Last active August 11, 2019 12:29
Bitbucket: push assets to AWS CloudFront
---
pipelines:
cloudfront:
- step:
image: python:3.5.1
script:
- pip install awscli
# set up AWS access credentials incl. region
- export AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}"
@sirodoht
sirodoht / migrate-django.md
Last active March 5, 2025 13:18
How to migrate Django from SQLite to PostgreSQL

How to migrate Django from SQLite to PostgreSQL

Dump existing data:

python3 manage.py dumpdata > datadump.json

Change settings.py to Postgres backend.

Make sure you can connect on PostgreSQL. Then:

@Thaina
Thaina / bitbucket-pipelines.yml
Created July 31, 2016 10:34
Bitbucket Pipeline publish to AWS Lambda with version
image: python:3.5.1
pipelines:
default:
- step:
script: # Modify the commands below to build and test your repository.
- apt-get update
- apt-get install -y zip
- zip -r $BITBUCKET_REPO_SLUG".zip" *
- pip install awscli
@devStepsize
devStepsize / slack_webhook_post.py
Last active December 14, 2024 22:20
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
@projectweekend
projectweekend / lambda_boto3_example.py
Last active February 8, 2022 13:03
Update AWS Lambda code with Boto3
import io
import os
from zipfile import ZipFile
from boto3.session import Session
session = Session(
aws_access_key_id='your-aws-access-key',
aws_secret_access_key='your-iam-secret-key',
region_name='your-aws-region')
@andyshinn
andyshinn / composer.json
Last active February 18, 2024 12:05
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@ianschenck
ianschenck / new_app.py
Last active July 30, 2023 03:00
Run your flask app under twisted wsgi, ALWAYS.
if __name__ == "__main__":
reactor_args = {}
def run_twisted_wsgi():
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.wsgi import WSGIResource
resource = WSGIResource(reactor, reactor.getThreadPool(), app)
site = Site(resource)