Skip to content

Instantly share code, notes, and snippets.

@TechNinjaWeb
TechNinjaWeb / CryptoKitties.sol
Created April 11, 2022 18:00 — forked from yogin/CryptoKitties.sol
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
const fetch = require('@zeit/fetch-cached-dns')(require('node-fetch'));
const {RateLimit} = require(`async-sema`);
const lim = new RateLimit(50);
module.exports = function getPost(SEGMENT_API_SECRET, s) {
return async function post(events) {
await lim();
const res = await fetch(`https://api.segment.io/v1/batch`, {
method: 'post',
body: JSON.stringify({batch: events}),
async function sendPayment(franchisors: [string], newFranchisor: string, artist: string, bootlegger: string, price: number) {
franchisors.push(bootlegger)
franchisors.push(artist)
const dividedPrice = price/franchisors.length
for (let i = 0; i < franchisors.length; i++) {
const franchisor = franchisors[i]
@TechNinjaWeb
TechNinjaWeb / .block
Created December 15, 2019 22:57 — forked from shimizu/.block
d3.forceSimulation - center node
license: mit
@TechNinjaWeb
TechNinjaWeb / Angular $AuthService Factory - Mockup
Created April 16, 2016 23:00 — forked from AlphaNerd/Angular $AuthService Factory - Mockup
Simple mockup of Angularjs user authentication service/factory
.factory('$authservice', ['$window', '$localstorage', '$state', function($window, $localstorage, $state) {
// Access local storage for existing user info
var SHIFT = $localstorage.getObject("Shift")
// Does session exist?
if (SHIFT && SHIFT.session.token) {
console.log("$authservice: Existing Session found: ", [SHIFT])
} else {
console.log("$authservice: No session found.")
SHIFT = {
session: {
@TechNinjaWeb
TechNinjaWeb / app.js
Created April 16, 2016 22:58 — forked from AlphaNerd/app.js
Solid framework for secure content, network connection status, and general route setup
// Ionic Starter App
// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'ngCordova'])
.run(function($ionicPlatform, $rootScope, $cordovaNetwork, $state, $authservice) {
$ionicPlatform.ready(function() {
@TechNinjaWeb
TechNinjaWeb / browserify.shim.js
Last active May 14, 2016 18:08 — forked from jshbrntt/gulpfile.js
Gulp + Watchify + Debowerify + Uglify
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Browserify Shims
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// var paths = require('./paths'); // Require Your Paths.JS file
module.exports = {
angular: {