Skip to content

Instantly share code, notes, and snippets.

@dievardump
dievardump / README.md
Last active January 25, 2023 14:55
Base file I used to use for my mainnet contracts to be compatible with OpenSea

Warning !!!

Recent events have shown that the auto-approval for user proxies is way too dangerous.

Security of users' NFTs should come before the convenience of auto approving collection for trading.

This is why I decided to remove the files in this gist.

Security risk

@akueisara
akueisara / Directed Graphs.md
Last active June 23, 2017 02:38
Week 2 of Coursera's Algorithms on Graphs

Directed Graphs

1. Directed Acyclic Graphs

(1) Directed Graphs

Definition

A directed graph is a graph where each edge has a start vertex and an end vertex.

(2) Directed DFS

  • Only follow directed edges.
  • explore(v) finds all vertices reachable from v.
  • Can still compute pre- and post- orderings.
@vasanthk
vasanthk / System Design.md
Last active June 23, 2024 04:30
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@craffel
craffel / draw_neural_net.py
Created January 10, 2015 04:59
Draw a neural network diagram with matplotlib!
import matplotlib.pyplot as plt
def draw_neural_net(ax, left, right, bottom, top, layer_sizes):
'''
Draw a neural network cartoon using matplotilb.
:usage:
>>> fig = plt.figure(figsize=(12, 12))
>>> draw_neural_net(fig.gca(), .1, .9, .1, .9, [4, 7, 2])
@bendangelo
bendangelo / EventManager.cs
Last active April 26, 2024 20:15
Unity3D C# Event Manager
/*
* Copyright 2017 Ben D'Angelo
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, subject to the following conditions:
@adityamenon
adityamenon / app.domainname
Last active December 28, 2021 06:31
My preferred configuration for a Laravel 4 API endpoint running over PHP-FPM, when I need to talk to it with AngularJS.
server {
root /path/to/app/public;
index index.php;
server_name test.dev;
set $cors_headers "whatever-custom-headers,you-would-like";
# redirection to index.php
location / {
try_files $uri $uri/ /index.php?$query_string;
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active June 13, 2024 10:59
A badass list of frontend development resources I collected over time.
@wmiller
wmiller / Events.cs
Last active October 22, 2023 06:39
Unity3D Event System
using System.Collections;
using System.Collections.Generic;
public class GameEvent
{
}
public class Events
{
static Events instanceInternal = null;
@3on
3on / phantom.js
Last active October 7, 2015 05:27
Scraping bootstrap for phantom.js
var system = require('system');
var page = require('webpage').create();
var url = "http://www.boston.com/bigpicture/";
var scrap = function(){
var r = {};
r.imgCount = $('img.bpImage').length;
r.imgURL = [];
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"