Skip to content

Instantly share code, notes, and snippets.

@natoinet
natoinet / lambda_ftp.py
Last active May 13, 2024 07:38
AWS Lambda in Python: Upload a new file from S3 to FTP
import os
import json
from ftplib import FTP
import boto3
# Source https://github.com/Vibish/FTP_SFTP_LAMBDA/blob/master/FTPThroughLambda.py
# https://www.edureka.co/community/17558/python-aws-boto3-how-do-i-read-files-from-s3-bucket
# https://medium.com/better-programming/transfer-file-from-ftp-server-to-a-s3-bucket-using-python-7f9e51f44e35
# https://github.com/kirankumbhar/File-Transfer-FTP-to-S3-Python/blob/master/ftp_to_s3.py
# https://dashbird.io/blog/python-aws-lambda-error-handling/
@ahmadshobirin
ahmadshobirin / set locale and timezone indonesia in laravel.md
Last active May 13, 2024 07:37
set locale and timezone indonesia in laravel

Open File App\Providers\AppServiceProvider

Change method boot

use Carbon\Carbon;


public function boot()
{
	config(['app.locale' => 'id']);
@iambryancs
iambryancs / pyenv-wsl-ubuntu_22.04.md
Created May 31, 2023 10:31
Using Pyenv in WSL Ubuntu 22.04 LTS to install Python 3.8

Using Pyenv in WSL Ubuntu 22.04 LTS to install Python 3.8

Env

  • Windows 10
  • Ubuntu 22.04 WSL
  • zsh

Requirements

  • git
@CodyReichert
CodyReichert / react-es6-flow-emacs-configuration.md
Last active May 13, 2024 07:35
Configuring Emacs for react, es6, and flow

Configuring Emacs for react, es6, and flow

For a while, JSX and new es6 syntax had flaky support in emacs, but there's been huge work on a lot of packages. Using emacs for JavaScript with React, ES6, and Flow (or Typescript, etc) is really easy and powerful in Emacs these days.

This is how you can work on modern web development projects with full support for tooling like JSX, Flow types, live eslint errors, automatic prettier.js formatting, and more.

Set up web-mode

web-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.

@cpicanco
cpicanco / Monokai.xml
Last active May 13, 2024 07:31
Dark theme for Lazarus IDE. Copy to "userschemes" inside primary config path
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Lazarus>
<ColorSchemes Version="11">
<Names Count="1">
<Item1 Value="Monokai"/>
</Names>
<Globals Version="11">
<SchemeMonokai>
<ahaGutter Background="2238503"/>
@mykeels
mykeels / states-and-cities.json
Created April 8, 2018 12:43
Nigerian States and Cities in JSON
[
{
"name": "Abia",
"cities": [
"Aba South",
"Arochukwu",
"Bende",
"Ikwuano",
"Isiala Ngwa North",
"Isiala Ngwa South",
@SebaUbuntu
SebaUbuntu / README.md
Last active May 13, 2024 07:26
Generate framework compatibility matrix from fqnames

Generate framework compatibility matrix from fqnames

  • Download these 2 files
  • Compile AOSP without fcm from stock and wait for check_vintf to error out
  • Delete Python prefix from all lines (e.g. checkvintf E 06-24 00:30:22 49120 49120 check_vintf.cpp:554])
  • Paste the result in fqnames.txt
  • Launch the script

借助git快速批量转换CRLF到LF


换行符的差异

  • windows下每行结尾为回车+换行(CR+LF),即 \r\n
  • unix和macOS下每行结尾为换行LF,即 \n
  • classic macOS(最后一个版本为1999年发布的Mac OS 9,可忽略)下为回车,即 \r

设置jetbrain系IDE

settings > Editor > Code Style > Line Separator > unix and macOS (\n)