Skip to content

Instantly share code, notes, and snippets.

@pau1m
pau1m / aliceButtonSendEther.js
Last active March 8, 2017 17:06
Alice Button Send Ether
function send() {
web3.eth.sendTransaction({
from: web3.eth.coinbase,
to: '0xE767aEB31dAAF66366999F72FB5De2CEEA76c277',
value: web3.toWei(document.getElementById("amount").value, 'ether')
}
@pau1m
pau1m / alicesButton.js
Created March 8, 2017 16:08
alices_button
<html>
<head>
<title>Introduction to Dapps. Simple MetaMask example.</title>
</head>
<body>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ut vestibulum diam. Nam varius eros eu dui molestie, et dignissim orci pellentesque. Praesent in ultrices magna. Fusce placerat eu nibh ut maximus. Nulla laoreet diam ac est congue, et varius ligula sollicitudin. Donec eu mi et sem hendrerit rhoncus vitae eu quam. Phasellus dictum congue erat. Etiam rutrum vel est eget mollis. Praesent volutpat turpis mi, id molestie sapien auctor consequat. Aenean laoreet elit ut lacus suscipit, sit amet fringilla orci dictum. Nam eget rhoncus neque. Vestibulum blandit eu ex a mattis.
</p>
<div id="meta-mask-required"></div>
<fieldset>
@pau1m
pau1m / 12block.js
Last active September 9, 2017 13:53
web 3 find transaction in 12th block
let filter = web3.eth.filter('latest')
filter.watch(function(error, result){
if (!error) {
let confirmedBlockId = web3.eth.blockNumber - 12
web3.eth.getBlock(confirmedBlockId, function(error, res){
if (!error) {
if (res.transactions.length > 0) {
res.transactions.forEach(function(txId){
web3.eth.getTransaction(txId, function(error, tx) {
if (!error && tx.to == account) {
Talk Jisc Team
Day / Hour / 5 mins
Start off reading out from lists. Testing, Deployment, Automation. UX. Coupling.
Link to talks http://conference.scotlandphp.co.uk/schedule/
All talks captured on video but not up yet afaict.
Keynote
======
@pau1m
pau1m / gignav
Created August 8, 2016 13:54
giganav
/**
* Setup Main Nav in large screen view
*/
//pjm commented out here
jisc.setupMainNavLarge = function() {
//console.log('main nav large firing');
//$('#search').insertAfter('#nav');
////Wrap submenu div around aside and child of primary nav, to match original jisc structure (retaining existing style)
//$('.j-giganav_primary__item__child').each(function(index, value) {
@pau1m
pau1m / vlad_ngrok
Created June 30, 2016 07:55
Use ngrok with drupal vlad vm
ngrok http -host-header=rewrite mydomain.com:80
@pau1m
pau1m / gist:aa09497e819de410196f
Last active August 29, 2015 14:28 — forked from dustincurrie/gist:938829
Programmatically create quicktabs
<?php
function mymodule_block($op = 'list', $delta = 0, $edit = array()) {
switch($op) {
case 'list':
$blocks['mymodule_quicktabs'] = array('info' => t('[mymodule] Quicktabs'));
return $blocks;
break;
case 'view':
switch ($delta) {
@pau1m
pau1m / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
<?php
/**
* Implements hook_menu().
*/
function mymodule_menu() {
$items['mymodule/%ctools_js/add'] = array(
'page callback' => 'mymodule_node_add_modal_callback',
'page arguments' => array(1),
'access arguments' => array('access content'),