Skip to content

Instantly share code, notes, and snippets.

@clowestab
clowestab / contracts...AssortedTests.sol
Created January 22, 2024 10:03
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.12 <0.9.0;
contract AssortedTests {
struct TestStruct {
NestedStruct[] nestedItems;
}
struct NestedStruct {
@clowestab
clowestab / .prettierrc.json
Created January 22, 2024 10:02
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
const axios = require('axios').default;
const mysql = require('mysql');
const util = require('util');
const slugify = require('slugify');
const GhostAdminAPI = require('@tryghost/admin-api');
const Downloader = require('nodejs-file-downloader');
//Helper function to setup a database wrapper that works with promises
//https://codeburst.io/node-js-mysql-and-async-await-6fb25b01b628
function makeDatabase() {
@clowestab
clowestab / Instagram-ghost.js
Created November 10, 2018 16:50
A script for synchronising your Instagram posts with your Ghost blog as discussed on my blog (https://thomasclowes.com)
const Parser = require('rss-parser');
const request = require('request');
const fs = require('fs');
const mime = require('mime-types');
const slugify = require('slugify');
//Enter your ghost credentials here
const clientId = "ghost-frontend";
const clientSecret = "enter-your-secret";
const username = "enter-your-email";
0x8be65246
0000000000000000000000000000000000000000000000000000000000000123
0000000000000000000000000000000000000000000000000000000000000080
3132333435363738393000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000e0
0000000000000000000000000000000000000000000000000000000000000002
0000000000000000000000000000000000000000000000000000000000000456
0000000000000000000000000000000000000000000000000000000000000789
000000000000000000000000000000000000000000000000000000000000000d
48656c6c6f2c20776f726c642100000000000000000000000000000000000000
final FrameLayout tabContent = (FrameLayout) view.findViewById(android.R.id.tabcontent);
View overlay = (View) view.findViewById(R.id.statusLayout);
overlay.setOnTouchListener(new View.OnTouchListener() {
private float mDownX;
private float mDownY;
private final float SCROLL_THRESHOLD = 10;
private boolean isOnClick;
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
//Watches our .jsx files and our .js. If any change, it calls the build task.
const gulp = require('gulp');
const runSequence = require('run-sequence');
const gutil = require('gulp-util');
//Boolean to hold state of watch JSX watch task
let taskOngoing = false;
//This task simply sets the taskOngoing boolean to false
gulp.task('jsxdone', function(callback) {
//Include and initialise web3
var Web3 = require("web3")
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
//Output the current block number (to check things are working)
web3.eth.blockNumber
//Output a list of accounts. On a new Parity node this will be empty []
web3.eth.accounts
<?php
public function callOldVersion($argumentsList) {
//If they have requested a NON current API version
if (APIHelpers::$API_VERSION != APIHelpers::CURRENT_API_VERSION) {
//get the name of the method that they have called
$actionName = $this->dispatcher->getActionName();