Skip to content

Instantly share code, notes, and snippets.

Hector Perez hectorperez

Block or report user

Report or block hectorperez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hectorperez
hectorperez / curl.md
Created May 4, 2018 — forked from subfuzion/curl.md
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@hectorperez
hectorperez / new_file0
Created Sep 14, 2017
get source code of function in python
View new_file0
import inspect
print(inspect.getsource(function_name))
@hectorperez
hectorperez / new_file0
Created May 2, 2017
declare/create rabbitmq queue
View new_file0
rabbitmqadmin declare queue name=my_queue_name durable=true
rabbitmqctl list_queues
View new_file0
SELECT *
FROM some_table
WHERE relevant_field IN
(
SELECT * FROM
(
SELECT relevant_field
FROM some_table
GROUP BY relevant_field
) AS subquery
View gist:537d3f49c8821c0cf7ed9a027277a97a
select w.name, a.extent from agreelist.agreements a
join agreelist.individuals i on i.id=a.individual_id
join(
SELECT JSON_EXTRACT_SCALAR(item, ‘$.id’) id,
JSON_EXTRACT_SCALAR(item, ‘$.sitelinks.enwiki.title’) name,
JSON_EXTRACT_SCALAR(item, ‘$.claims.P108[0].mainsnak.datavalue.value.numeric-id’) award1,
JSON_EXTRACT_SCALAR(item, ‘$.claims.P108[1].mainsnak.datavalue.value.numeric-id’) award2,
JSON_EXTRACT_SCALAR(item, ‘$.claims.P108[2].mainsnak.datavalue.value.numeric-id’) award3,
JSON_EXTRACT_SCALAR(item, ‘$.claims.P108[3].mainsnak.datavalue.value.numeric-id’) award4,
JSON_EXTRACT_SCALAR(item, ‘$.claims.P108[4].mainsnak.datavalue.value.numeric-id’) award5,
View gist:b19f0ce6b324670a6e6371529679837f
select w.name, a.extent from agreelist.agreements a
join agreelist.individuals i on i.id=a.individual_id
join(
SELECT JSON_EXTRACT_SCALAR(item, ‘$.id’) id,
JSON_EXTRACT_SCALAR(item, ‘$.sitelinks.enwiki.title’) name,
JSON_EXTRACT_SCALAR(item, ‘$.claims.P166[0].mainsnak.datavalue.value.numeric-id’) award1,
JSON_EXTRACT_SCALAR(item, ‘$.claims.P166[1].mainsnak.datavalue.value.numeric-id’) award2,
JSON_EXTRACT_SCALAR(item, ‘$.claims.P166[2].mainsnak.datavalue.value.numeric-id’) award3,
JSON_EXTRACT_SCALAR(item, ‘$.claims.P166[3].mainsnak.datavalue.value.numeric-id’) award4,
JSON_EXTRACT_SCALAR(item, ‘$.claims.P166[4].mainsnak.datavalue.value.numeric-id’) award5,
View Copy all to file - screen
Ctrl + a and then :
hardcopy -h <filename>
View capybara.md

Capybara

save_and_open_page

Matchers

have_button(locator)
@hectorperez
hectorperez / Running Specs from Vim - Sent to tmux via Tslime
Created Nov 6, 2015
Running Specs from Vim, Sent to tmux via Tslime
View Running Specs from Vim - Sent to tmux via Tslime
<leader>t RunCurrentSpecFile
<leader>s RunNearestSpec
<leader>l RunLastSpec
<leader>a RunAllSpecs
# Install Vim plugins: vim-rspec and tslime.vim
# Add the following to .vimrc:
let g:rspec_command = 'call Send_to_Tmux("rspec {spec}\n")'
" vim-rspec mappings
You can’t perform that action at this time.