Skip to content

Instantly share code, notes, and snippets.

View smsaladi's full-sized avatar
💭
💻 typing...

Shyam Saladi smsaladi

💭
💻 typing...
View GitHub Profile
@alxndrkalinin
alxndrkalinin / gist:6cc4228e9178ec4af7b2696a0d1ad5a1
Last active April 13, 2018 19:32
[bug] keras.fit_generator(Sequence)
import numpy as np
from keras.models import Model, Sequential
from keras.layers import Input, Dense, Activation
from keras.utils.data_utils import Sequence
from keras.losses import categorical_crossentropy
from keras.optimizers import SGD
class CustomSequence(Sequence):
def __init__(self, x_set, y_set, batch_size):
self.X,self.y = x_set,y_set
@jeroenvermeulen
jeroenvermeulen / lndupes.py
Last active October 7, 2020 10:03 — forked from filipenf/lndupes.py
Reads fdupes(-r1) output and create relative symbolic links for each duplicate
#!/usr/bin/env python
# source: https://gist.github.com/filipenf/e9901883d66b8da65c151cf674e5f2a9
#
# Reads fdupes(-r -1) output and create relative symbolic links for each duplicate
# usage: fdupes -r1 . | ./lndupes.py
import os
from os.path import dirname, relpath, basename, join
import sys
import shlex
@JoaoRodrigues
JoaoRodrigues / hydrophobic_moment.md
Last active July 13, 2022 20:40
Peptide/Protein Hydrophobic Moment Calculator
@max-mapper
max-mapper / bibtex.png
Last active March 10, 2024 21:53
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@chaoflow
chaoflow / model.py
Created April 20, 2017 10:26
sqlite WITHOUT ROWID with (flask-)sqlalchemy
import flask_sqlalchemy
from sqlalchemy import schema
from sqlalchemy.ext.compiler import compiles
db = flask_sqlalchemy.SQLAlchemy()
class Tag(db.Model):
__table_args__ = {'info': {'without_rowid': True}}
text = db.Column(db.String, primary_key=True)
@filipenf
filipenf / lndupes.py
Created August 19, 2016 19:04
Reads fdupes(-r1) output and create relative symbolic links for each duplicate
#!/usr/bin/env python
# Reads fdupes(-r -1) output and create relative symbolic links for each duplicate
# usage: fdupes -r1 . | ./lndupes.py
import os
from os.path import dirname, relpath, basename, join
import sys
lines = sys.stdin.readlines()
@shantanuo
shantanuo / mysql_to_big_query.sh
Last active September 14, 2022 07:12
Copy MySQL table to big query. If you need to copy all tables, use the loop given at the end. Exit with error code 3 if blob or text columns are found. The csv files are first copied to google cloud before being imported to big query.
#!/bin/sh
TABLE_SCHEMA=$1
TABLE_NAME=$2
mytime=`date '+%y%m%d%H%M'`
hostname=`hostname | tr 'A-Z' 'a-z'`
file_prefix="trimax$TABLE_NAME$mytime$TABLE_SCHEMA"
bucket_name=$file_prefix
splitat="4000000000"
bulkfiles=200
@keisukefukuda
keisukefukuda / gist:1991869
Created March 7, 2012 08:15
iptables script
#!/bin/sh
IF=eth0
iptables -F
iptables -t nat -F
iptables -X
iptables -Z
# drop all packets by default