Skip to content

Instantly share code, notes, and snippets.

View pitervergara's full-sized avatar

Piter Vergara pitervergara

  • Porto Alegre - RS - Brasil
View GitHub Profile
That’s one of the real strengths of Docker: the ability to go back to a previous commit. The secret is simply to docker tag the image you want.
Here’s an example. In this example, I first installed ping, then committed, then installed curl, and committed that. Then I rolled back the image to contain only ping:
$ docker history imagename
IMAGE CREATED CREATED BY SIZE
f770fc671f11 12 seconds ago apt-get install -y curl 21.3 MB
28445c70c2b3 39 seconds ago apt-get install ping 11.57 MB
8dbd9e392a96 7 months ago 131.5 MB
@pitervergara
pitervergara / settings_test_snippet.py
Created June 6, 2016 21:08 — forked from NotSqrt/settings_test_snippet.py
Another shot at this problem ..
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return "notmigrations"
MIGRATION_MODULES = DisableMigrations()
@pitervergara
pitervergara / gist:8a6aa9732b542b573d3498c529cf3b20
Last active December 26, 2022 17:12 — forked from slav123/gist:4274088
Extract Number From String MySQL
DROP FUNCTION IF EXISTS `uExtractNumberFromString`;
DELIMITER $$
CREATE FUNCTION `uExtractNumberFromString`(in_string varchar(255)) RETURNS varchar(255) DETERMINISTIC
BEGIN
DECLARE ctrNumber varchar(255);
DECLARE finNumber varchar(255) default ' ';
DECLARE sChar varchar(2);
DECLARE inti INTEGER default 1;