Skip to content

Instantly share code, notes, and snippets.

View AndersonFirmino's full-sized avatar
๐Ÿ
๐Ÿ“œ ๐ŸŽผ ๐ŸŽฎ ๐Ÿง ๐Ÿฆ†

Anderson Araujo AndersonFirmino

๐Ÿ
๐Ÿ“œ ๐ŸŽผ ๐ŸŽฎ ๐Ÿง ๐Ÿฆ†
View GitHub Profile
#!/usr/bin/env python
# USAGE: ./convert_report_to_cucumber_format.py --behave-report bdd/report.json [--json-schema cucumber-report-schema.json]
import argparse, json, sys
def main(argv):
args = parse_args(argv)
with open(args.behave_report, 'r') as json_file:
@AndersonFirmino
AndersonFirmino / .gitignore
Created April 22, 2017 07:09 — forked from smebberson/.gitignore
Express simple authentication example
node_modules
*.swp
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@AndersonFirmino
AndersonFirmino / gist:3b60be5b279582870995e695b8f0262c
Created March 11, 2017 21:28 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@AndersonFirmino
AndersonFirmino / auth.markdown
Created March 3, 2017 06:58 — forked from mlynch/auth.markdown
AngularJS Authentication and CORS

Single Page Apps are ruling the world and AngularJS is leading the charge. But many of the lessons we learned in the Web 2.0 era no longer apply, and few are as drastically different as authentication.

CORS

CORS is an oft-misunderstood feature of new browsers that is configured by a remote server. CORS stands for Cross-Origin-Resource-Sharing, and was designed to make it possible to access services outside of the current origin (or domain) of the current page.

Like many browser features, CORS works because we all agree that it works. So all major browsers like Chrome, Firefox, and IE support and enforce it. By using these browsers, you benefit from the security of CORS.

That means certain browsers do not enforce it, so it is not relevant there. One large example is a native Web View for things like Cordova and Phonegap. However, these tools often have configuration options for whitelisting domains so you can add some security that way.

@AndersonFirmino
AndersonFirmino / 0_urllib2.py
Created March 1, 2017 13:23 — forked from kennethreitz/0_urllib2.py
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@AndersonFirmino
AndersonFirmino / 0_urllib2.py
Created March 1, 2017 13:23 — forked from kennethreitz/0_urllib2.py
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@AndersonFirmino
AndersonFirmino / rename_git_branch_locally_and_retome.txt
Last active February 28, 2017 15:36 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@AndersonFirmino
AndersonFirmino / Selenium.Python.InjectJS.py
Created January 4, 2017 19:00 — forked from anhldbk/Selenium.Python.InjectJS.py
Inject jQuery into Selenium Driver
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('https://www.facebook.com/')
with open('jquery-1.9.1.min.js', 'r') as jquery_js:
jquery = jquery_js.read() #read the jquery from a file
driver.execute_script(jquery) #active the jquery lib
driver.execute_script("$('#email').text('anhld')")
@AndersonFirmino
AndersonFirmino / web-servers.md
Created December 26, 2016 19:24 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000