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
@pitervergara
pitervergara / bower list
Created November 3, 2017 11:24
List of bower packages installed when the issue #1126 was registered in angular-datatables repo.
```bash
(python27-ve-intra-dj111)<intra>[pitervergara@vmdes-uai:/var/www/intra/django111/faccoes/static/faccoes] bower list
bower check-new Checking for new versions of the project dependencies...
faccoes#0.0.0 /var/www/intra/django111/faccoes/static/faccoes
├── angular#1.6.6 (1.6.7-build.5494+sha.667db46 available)
├─┬ angular-animate#1.6.6 (1.6.7-build.5494+sha.667db46 available)
│ └── angular#1.6.6 (latest is 1.6.7-build.5494+sha.667db46)
├─┬ angular-cookies#1.6.6 (1.6.7-build.5494+sha.667db46 available)
│ └── angular#1.6.6
├── angular-datatables#4.4.0 (4.4.1 available)
[
{
"model": "sitetree.tree",
"pk": 1,
"fields": {
"title": "Main Tree",
"alias": "maintree"
}
},
{
@pitervergara
pitervergara / entrypoint.sh
Created September 14, 2016 04:14
Docker entrypoint to test and wait for service dependencies
```bash
#!/bin/bash
# List all deps using this format: ("host port", "host port"). Remember to link the container using the 'host' name.
requirements=("postgis 5432" "redis 6379" "elasticsearch 9200")
cmd="$@"
missing_requirement=true
while [ "${missing_requirement}" == "true" ]
do
@pitervergara
pitervergara / gist:7dca6204111e0a1f5d7a72b04087afd4
Last active July 13, 2016 04:47
Dump Wercker possible bug with localservices
$ docker version
Client:
Version: 1.10.3-cs3
API version: 1.22
Go version: go1.5.4
Git commit: 6df5588
Built: Wed Apr 27 01:00:56 2016
OS/Arch: linux/amd64
Server:
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;