Skip to content

Instantly share code, notes, and snippets.

View ramdesh's full-sized avatar
🎸
Managing incidents

Ramindu Deshapriya ramdesh

🎸
Managing incidents
View GitHub Profile
@ramdesh
ramdesh / keras_model_s3_wrapper.py
Created December 8, 2020 21:56
Save and load Keras models to and from AWS S3
import s3fs
import zipfile
import tempfile
import numpy as np
from tensorflow import keras
from pathlib import Path
import logging
AWS_ACCESS_KEY="aws_access_key"
@ramdesh
ramdesh / .flake8
Last active September 16, 2024 20:12
pre-commit config yaml
[flake8]
max-line-length = 100
ignore = E203,W503,W605
@ramdesh
ramdesh / gdrive_img_url.js
Created April 2, 2018 06:30
GDrive view image sharing url
var url = "https://drive.google.com/uc?export=download&id=18uDNHqzEK3DrxcFhL5SjU4zpGCqOq53R";
@ramdesh
ramdesh / lambda_tg_bot_trigger.js
Created March 18, 2018 14:48
Lambda Telegram Trigger
var http = require('https');
var AWS = require('aws-sdk');
exports.handler = (event, context) => {
var codecommit = new AWS.CodeCommit({ apiVersion: '2015-04-13' });
var baseUrl = "https://api.telegram.org/bot416356188:AAGaWMHjEXsxTmXb4c6GAsIkLbpwpWMUMzs/sendMessage?chat_id=-283837997&text=";
//Log the updated references from the event
var commits = event.Records[0].codecommit.references.map(
@ramdesh
ramdesh / vesuvius_t()_bash
Created August 20, 2012 07:06
Checking for strings in Sahana Vesuvius which haven't been enclosed in a _t() function
grep -nr --include="*.php" "'" ~/vesuvius | grep -Ev "_t\(\"|_t\(\'|\[\"|\[\'|//|/\*|\*|\*/|SELECT|UPDATE|INSERT|DELETE|WHERE|VALUE|VALUES|ADD" >single-quote-greps.txt
grep -nr --include="*.php" '"' ~/vesuvius | grep -Ev "_t\(\"|_t\(\'|\[\"|\[\'|//|/\*|\*|\*/|SELECT|UPDATE|INSERT|DELETE|WHERE|VALUE|VALUES|ADD" >double-quote-greps.txt