Skip to content

Instantly share code, notes, and snippets.

View mikedizon's full-sized avatar

Michael Dizon mikedizon

View GitHub Profile
@DanielCender
DanielCender / fetchItemsNextToken.js
Created November 24, 2019 04:46
A recursive function calling AppSyncClient GraphQL requests for ReactNative apps
import { Logger } from 'aws-amplify';
const logger = new Logger('fetchItemsNextToken', 'VERBOSE');
/**
* @desc Recursively fetch all items in a list query using nextToken
* @param {Object} client An AppSyncClient instantiation
* @returns {Object} { items, key } Items are results,
* key is the name of the query called.
*/
@bl4ck5un
bl4ck5un / ck.diff
Created February 25, 2019 21:09
Difference between the old and the new cryptokitties' geneScience smart contract
diff --git a/old.sol b/new.sol
index 0184107..1419bcd 100644
--- a/old.sol
+++ b/new.sol
@@ -1,16 +1,35 @@
pragma solidity ^0.4.18;
-
+contract KittyCoreInterface {
+ function cooAddress() public returns(address);
@yogin
yogin / CryptoKitties.sol
Created January 28, 2018 19:06
CryptoKitties
// Copied from: https://ethfiddle.com/09YbyJRfiI
// CryptoKitties Source code
// Copied from: https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code
pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
[
{
"action": {
"type": "block"
},
"trigger": {
"url-filter": ".*",
"resource-type": ["script"],
"load-type": ["third-party"],
"if-domain": ["imore.com"]
@readevalprint
readevalprint / serializer.py
Created September 25, 2013 20:39
django-haystack SearchResultSerializer from django-rest-framework
==== SNIP ====
class DistanceSerializer(serializers.Serializer):
km = serializers.FloatField()
m = serializers.FloatField()
mi = serializers.FloatField()
ft = serializers.FloatField()
class SearchResultSerializer(serializers.Serializer):
@manveru
manveru / backup.rb
Created August 31, 2011 09:02
Storing product activity from net-a-porter
require 'sqlite3'
sdb = SQLite3::Database.new('net-a-porter.sqlite3')
ddb = SQLite3::Database.new('net-a-porter-backup.sqlite3')
b = SQLite3::Backup.new(ddb, 'main', sdb, 'main')
begin
b.step(1)
end while b.remaining > 0