Skip to content

Instantly share code, notes, and snippets.

@eshnil2000
eshnil2000 / curl.md
Created November 20, 2019 05:54 — forked from subfuzion/curl.md
curl POST examples

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.

@eshnil2000
eshnil2000 / wc-remove-billing-fields.php
Created September 29, 2019 22:36 — forked from claudiosanches/wc-remove-billing-fields.php
WooCommerce - Remove billing address, fone and company fields
<?php
/**
* Plugin Name: WooCommerce Remove billing fields
* Description: Remove billing address, fone and company fields from WooCommerce checkout.
* Author: Claudio Sanches
* Author URI: https://claudiosmweb.com
* Version: 0.0.1
* License: GPLv2 or later
*/
@eshnil2000
eshnil2000 / MyToken.abi
Last active December 15, 2018 06:44
Ethereum Smart Contract example
[ { "constant": true, "inputs": [], "name": "get", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "address" } ], "name": "balanceOf", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" } ], "name": "transfer", "outputs": [ { "name": "success", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "name": "initialSupply", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" } ]
print('hi)
@eshnil2000
eshnil2000 / test
Last active December 6, 2018 02:07
import hashlib;
import unittest;
from unittest import TestCase;
for i in range(10):
print(i);
print(x);
#!/bin/bash
for i in {1..4}; do
curl -H "Content-Type: application/json" -d '{"password":"thepass","method":"rateSatisfaction","args":{"isHappy":true},"value":0}' http://localhost:8000/users/oracle/bde10fdb31c8b7f17b7bcc57d402b4f355e7a817/contract/microAPI/27a2d478ec595617e5c49f9572f49f21b644c944/call
sleep 5
echo "waiting..."
done
for i in {1..2}; do
curl -H "Content-Type: application/json" -d '{"password":"thepass","method":"rateSatisfaction","args":{"isHappy":true},"value":0}' http://localhost:8000/users/oracle/bde10fdb31c8b7f17b7bcc57d402b4f355e7a817/contract/microAPI/d95c212e7060188168325faf05719bd03bd23638/call
sleep 5
<div id="contract_source" style="display: none;">
contract microAPI {
/**
* It is helpful to think of
* smart contracts as state machine.
* In this example:
* State 1: Deploy new smart pizza contract
* State 2: Set pizza details; price, toppings, and guarante
* State 3: Smart contract is funned by buyer
* State 4: Pizza is being delivered
.controller('AppCtrl', function($scope, $ionicModal, $timeout, $sce, DataLoader, $rootScope, $log ) {
// Enter your site url here. You must have the WP-API v2 installed on this site. Leave /wp-json/wp/v2/ at the end.
//$rootScope.url = 'http://www.mysite.com/wp-json/wp/v2/';
$rootScope.url = 'http://codenovator.com/wp-json/wp/v2/';
// $rootScope.callback = '_jsonp=JSON_CALLBACK';
})
<!--a class="coinbase-button" data-code="8675c8797d155ce2778ea8edffc75143"
data-button-style="buy_now_small" href="https://coinbase.com/checkouts/8675c8797d155ce2778ea8edffc75143">Pay With Bitcoin</a>
<script src="https://coinbase.com/assets/button.js" type="text/javascript"></script!-->