Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jleo3
jleo3 / times_square.sol
Created January 9, 2022 15:53
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.0+commit.c7dfd78e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
import "https://github.com/0xcert/ethereum-erc721/src/contracts/tokens/nf-token-metadata.sol";
import "https://github.com/0xcert/ethereum-erc721/src/contracts/ownership/ownable.sol";
contract newNFT is NFTokenMetadata, Ownable {
constructor() {
nftName = "Synth NFT";
#! /usr/bin/env bash
set -o errexit
sudo apt-get update && sudo apt-get upgrade
install="sudo apt-get install -y -q"
update="sudo apt-get update -q"
# setup install directory
mkdir -p /tmp/install

Refactoring

Here's a list of resources I pulled together that explain what refactoring is, why it exists, what code smells are, and the mechanics of refactoring.

The Theory of Refactoring

  • use the react-rails gem
  • generator will create an app/assets/javascripts/components/ dir
  • In the view:
<%= react_component 'Records', { data: @records } %
  • Learn to use @state with @setState, a React method that will perform 2 actions.

  • Where does @props get initialized?

  • Have a look at Jest for unit testing.

@jleo3
jleo3 / links.md
Created May 13, 2015 15:05
Discussion and Links from Office Hours
@jleo3
jleo3 / links.md
Last active August 29, 2015 14:19
Discussions and Links from Office Hours
@potential_errors =[]
params = { filepicker: true, created_at: DateTime.parse("2015-01-25 14:48:09")..DateTime.parse("2015-04-01 19:50") }
grouped_count = Attachment.where(params).group("original_filename").having("count(1) > 1").count ; nil
grouped_attachments = grouped_count.map { |count| Attachment.where(params.merge(original_filename: count.first)).to_a } ; nil
grouped_attachments.each do |group|
arr = group.map &:document_file_size
if arr.uniq != arr
@potential_errors << group
end
@jleo3
jleo3 / 11_march_2015_notes.md
Last active August 29, 2015 14:17
Notes from Community Recycling meeting
@jleo3
jleo3 / main.go
Created February 28, 2015 15:11
E-Go Exercise: Control Structures
package main
import "fmt"
func main() {
for i := 0; i < 10; i++ {
fmt.Printf("%d ", i)
}
fmt.Println("")
@jleo3
jleo3 / real_estate_site.md
Last active August 29, 2015 14:16
Considerations for a Real Estate Website

Building an Informative Real Estate Website with Def Method

This document describes what building a real estate website entails using Def Method. With this information and your feedback I can ballpark a price.

Examples

I've looked at a couple of sites that are similar to what I think you need. Note that I chose these sites because they serve the function you described. The form varies wildly: