Skip to content

Instantly share code, notes, and snippets.

View zvictor's full-sized avatar
🐥

Victor Duarte zvictor

🐥
View GitHub Profile
import * as cdk from 'aws-cdk-lib'
import * as ec2 from 'aws-cdk-lib/aws-ec2'
import * as ecs from 'aws-cdk-lib/aws-ecs'
import * as efs from 'aws-cdk-lib/aws-efs'
import * as logs from 'aws-cdk-lib/aws-logs'
export class BaseStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, environment: Record<string, string>, props?: cdk.StackProps) {
super(scope, id, props)
url="https://www.sky-tours.com/book.php?lang=br&book=T%3A0%3A0%7C0%3A0&key=GRULIS01%2F29%2F20199900LISGRU02%2F12%2F20199900Y010000&life=259200&api=8DvtxVAx0a24RCclYM98SXNMREhsn7Rttjqw18y%2BADwnCP7f5s%2Fr%2BiR433%2F0GhGy&session=7ffa6218-3fe9-4abb-b334-df2ad0231d74&check=Zqu1N8OWSNSgKJZnr0GKMzdC0Y1diINlC1peKuMVM9l27dG29UP0dfQ8TMa9UvH7mGqgRv7mh6LIeoPQzUKxF%2Byx1tl%2BROygG4DhTsV1%2FdmqjsCRb7GbztH4oEA1ZN5tG58BrBRBTaCLR1y9P5YuIjK64GMD%2Fim8GC2RtGOF1Cw%3D&sdata=mBxS%2B3rVvwH6%2BBlfqs0ln0WWSYlMYEnnJdeo%2Fy8Oad7jWZjj%2BfIHjEg3sc5DBwPDaIAt11ISI3EuqbYV%2BNsmGL5MkFPUhRRyi17soJvXYMU%3D"
# url="https://google.com"
echo "waiting for: $url"
echo ""
while ! (wget -q -O - "$url" > /dev/null) ; do
echo 'failed attempt'
done
while true ; do
@zvictor
zvictor / Git alias
Last active November 16, 2016 16:13
A simplified version of the git commands found on http://www.praqma.com/stories/a-pragmatic-workflow/
# Based on http://www.praqma.com/stories/a-pragmatic-workflow/
#
# Add this to your git configurations using:
# $ git config --global --edit
[alias]
issue-branch = "!f() { MATCH=#$1:; ghi show $1 2>/dev/null | grep $MATCH | sed s/$MATCH/$1/g | sed 's/ /-/g' | sed s/[:\\']//g; }; f"
issue-wip = "!f() { ghi label $1 'in progress'; }; f"
work-on = "!f() { BRANCH=`git issue-branch $1`; git fetch origin; git checkout $BRANCH 2> /dev/null || git checkout -b $BRANCH; git issue-wip $1; ghi assign $1; }; f"
box: ubuntu:16.04
services:
- mongo # http://devcenter.wercker.com/docs/services/mongodb.html
initial-build:
steps:
- script:
name: start apt-get
code: |
apt-get update
@zvictor
zvictor / react.css.js
Created June 3, 2016 17:23
List of css modules for React to be evaluated at http://www.timqian.com/star-history/
var list = ['Khan/aphrodite',
'martinandert/babel-plugin-css-in-js',
'rtsao/csjs',
'webpack/css-loader',
'jareware/css-ns',
'krasimir/cssx',
'colingourlay/hyperstyles',
'j2css/j2c',
'petehunt/jsxstyle',
'FormidableLabs/radium',
@zvictor
zvictor / modulus.npm.log
Created August 8, 2013 18:51
npm log from Modulus
$ modulus deploy
Welcome to Modulus
You are logged in as zvictor
[?] Are you sure you want to use project slirp? (yes)
Compressing project...
636.8 KB written
Uploading project...
Upload progress [===================] 100%
Deploying Project...
INFO: Attaching persistent storage.
@zvictor
zvictor / aggregation.js
Created August 6, 2013 17:08
Aggregation (distinct, aggregate and mapReduce) extension for Meteor's Smart-collection
var Future, path, _dummyCollection_, _futureWrapper;
path = Npm.require("path");
Future = Npm.require(path.join("fibers", "future"));
_dummyCollection_ = new Meteor.Collection('__dummy__');
_futureWrapper = function(collection, commandName, args) {
var col, collectionName, future, result,
_this = this;
col = (typeof collection) === "string" ? _dummyCollection_ : collection;
collectionName = (typeof collection) === "string" ? collection : collection._name;
@zvictor
zvictor / django-crossdomainxhr-middleware.py
Created June 10, 2012 20:50 — forked from vicalejuri/django-crossdomainxhr-middleware.py
Middlware to allow's your django server to respond appropriately to cross domain XHR (postMessage html5 API).
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
@zvictor
zvictor / models.py
Created November 9, 2011 11:24
An example how to connect userena with django-social registration.
from socialregistration.signals import connect as profile_connect
from userena.managers import ASSIGNED_PERMISSIONS
@receiver(socialregistration_signals.connect, sender = FacebookProfile, dispatch_uid = 'facebook.connect')
def social_connect_callback(sender, user, profile, client, **kwargs):
"""
Create a profile for this user after connecting
"""
# Create a userena user.