Skip to content

Instantly share code, notes, and snippets.

View edumucelli's full-sized avatar

Eduardo edumucelli

View GitHub Profile
@fchollet
fchollet / classifier_from_little_data_script_1.py
Last active May 15, 2024 07:19
Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@ianturton
ianturton / Buffer
Last active January 30, 2021 16:38
Buffer a GeoTools Linestring, this code creates a new polygon at a specified distance around the provided line.
package com.ianturton.cookbook.operations;
import java.util.List;
import javax.measure.Measure;
import javax.measure.quantity.Length;
import javax.measure.unit.SI;
import org.geotools.data.DataUtilities;
import org.geotools.feature.SchemaException;
@datagrok
datagrok / README.md
Last active November 20, 2023 22:00
What happens when you cancel a Jenkins job

When you cancel a Jenkins job

Unfinished draft; do not use until this notice is removed.

We were seeing some unexpected behavior in the processes that Jenkins launches when the Jenkins user clicks "cancel" on their job. Unexpected behaviors like:

  • apparently stale lockfiles and pidfiles
  • overlapping processes
  • jobs apparently ending without performing cleanup tasks
  • jobs continuing to run after being reported "aborted"

Integrating Stripe with Rails

This written tutorial covers building a payment system into a Rails app using Stripe.js. It assumes a basic familiarity with Ruby on Rails, Git and the command-line.

There is a slightly contracted version of this tutorial available here.

What's covered

  • Setting up a basic Rails app with a scaffold generator
  • Integrating Stripe charges
@lost-theory
lost-theory / gist:3772472
Created September 23, 2012 17:48
upload file with flask test client
import unittest
from app import app
from cStringIO import StringIO
class UploadTest(unittest.TestCase):
def setUp(self):
self.app = app
self.app.config['TESTING'] = True
self.client = self.app.test_client()