Skip to content

Instantly share code, notes, and snippets.

@DSalko
DSalko / gist:629d110eef72894f6589c89980b7d043
Created May 27, 2020 15:31
Three CURL commands for Alfajores testnet - celoGold balance of address 0xd86518b29bb52a5dac5991eacf09481ce4b0710d
$ curl https://alfajores-forno.celo-testnet.org/ --header "Content-Type: application/json" --request POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{ "to": "0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9", "from": "0xd86518b29bb52a5dac5991eacf09481ce4b0710d", "data": "0x70a08231000000000000000000000000d86518b29bb52a5dac5991eacf09481ce4b0710d" }, "latest"],"id":1}'
>> {"jsonrpc":"2.0","id":1,"result":"0xffffffffffffffffffffffffffffffffffffffff6afd0700000000012a05f1ff"}
$ curl https://alfajores-forno.celo-testnet.org/ --header "Content-Type: application/json" --request POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{ "to": "0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9", "data": "0x70a08231000000000000000000000000d86518b29bb52a5dac5991eacf09481ce4b0710d" }, "latest"],"id":1}'
>> {"jsonrpc":"2.0","id":1,"result":"0x0000000000000000000000000000000000000000000000005344a328fd033276"}
$ curl https://alfajores-forno.celo-testnet.org/ --header "Content-Type: application/json" --request POST --d
@DSalko
DSalko / gist:cfd6175f49fab1e825b75fa5b2e72f2c
Created January 20, 2018 00:48 — forked from kublaios/gist:f01cdf4369c86ddd6d71
Making a PEM File for iOS Push Notifications (From Ray Wenderlich's tutorial)
# Convert the .cer file into a .pem file:
$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem
# Convert the private key’s .p12 file into a .pem file:
$ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem
# Finally, combine the certificate and key into a single .pem file
$ cat PushChatCert.pem PushChatKey.pem > ck.pem
# At this point it’s a good idea to test whether the certificate works.
@DSalko
DSalko / gist:cda4d6b4726e117ba9df40bbb4c3811b
Created January 20, 2018 00:48 — forked from kublaios/gist:f01cdf4369c86ddd6d71
Making a PEM File for iOS Push Notifications (From Ray Wenderlich's tutorial)
# Convert the .cer file into a .pem file:
$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem
# Convert the private key’s .p12 file into a .pem file:
$ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem
# Finally, combine the certificate and key into a single .pem file
$ cat PushChatCert.pem PushChatKey.pem > ck.pem
# At this point it’s a good idea to test whether the certificate works.
@DSalko
DSalko / add_to_slack.html.erb
Last active May 13, 2016 04:32
"Add to Slack" with Google analytics event
<a onclick="ga('send','event','slack','add_to_slack')" target="_blank"
href="https://slack.com/oauth/authorize?scope=incoming-webhook&amp;client_id=XXX.XXX&amp;redirect_uri=<%= callback_slack_url %>">
<img alt="Add to Slack" height="40" width="139" src="https://platform.slack-edge.com/img/add_to_slack.png" srcset="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x" />
</a>
@DSalko
DSalko / carrierwave.rb
Created January 31, 2016 23:37 — forked from yortz/carrierwave.rb
image_uploader.rb
#config/initializers/carrierwave.rb
CarrierWave.configure do |config|
if Rails.env.production? or Rails.env.development?
config.storage :cloud_files
config.cloud_files_username = "your_username"
config.cloud_files_api_key = "your_key"
config.cloud_files_container = "test"
config.cloud_files_cdn_host = "c0012345.cdnn.cloudfiles.rackspacecloud.com"
def store_dir
@DSalko
DSalko / details_after_unescaping.json
Created December 5, 2015 00:55
Details escaping problem
{"data":[{"value":"Job News San Antonio Job Fair on Wednesday, January 20, 2016","label":"Event*"}],"model":[{"container_id":"container_4844","product_field_id":3,"rows":[{"tr_id":"container_4844_row_0","cross_dom_element_id":"","dp_field_name":"container_4844_row_0_remote_enum","dp_field_id":"container_4844_row_0_remote_enum","dp_field_value":"Job News San Antonio Job Fair on Wednesday, January 20, 2016","dp_label":"Event*","required":true,"show_red_label":false,"data_type":64,"enum_fields":[],"remote_enum_fields":"{\"items\":[{\"label\":\"Job News San Antonio Job Fair on Wednesday, January 20, 2016\",\"value\":\"Job News San Antonio Job Fair on Wednesday, January 20, 2016\"},{\"label\":\"Job News Miami Job Fair on Tuesday, January 26, 2016\",\"value\":\"Job News Miami Job Fair on Tuesday, January 26, 2016\"},{\"label\":\"Job News Columbus Job Fair on Wednesday, January 27, 2016\",\"value\":\"Job News Columbus Job Fair on Wednesday, January 27, 2016\"},{\"label\":\"Job News Kansas City Job Fair on Wednesday,
@DSalko
DSalko / form1.cs
Created August 27, 2015 14:28
PushSharp to android
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PushSharp;

Capybara

save_and_open_page

Matchers

have_button(locator)