Skip to content

Instantly share code, notes, and snippets.

View moflo's full-sized avatar
🎯
Focusing

moflo moflo

🎯
Focusing
View GitHub Profile
@moflo
moflo / App.js
Created November 20, 2021 22:22 — forked from farzaa/App.js
import './styles/App.css';
import twitterLogo from './assets/twitter-logo.svg';
import { ethers } from "ethers";
import React, { useEffect, useState } from "react";
import myEpicNft from './utils/MyEpicNFT.json';
const TWITTER_HANDLE = '_buildspace';
const TWITTER_LINK = `https://twitter.com/${TWITTER_HANDLE}`;
const OPENSEA_LINK = '';
const TOTAL_MINT_COUNT = 50;
import UIKit
// CSV column filtering
// Generate function which takes CSV string and column names as input and return array of sums of column data
// For example, a string of CSV data includes a header row, and columns consisting of Double and Strings.
func csvSum(_ csv:String,_ names: String) -> [Double]? {
let rows :[String] = csv.split(separator: "\n").map { String($0) }
@moflo
moflo / Webcrawl YCombinator Database, ycdb.co
Created December 8, 2018 01:55
Use the Ruby Capybara-based Kimurai web crawler to iterate through the YCDB.co data and populate an AirTable spreadsheet
require 'airrecord'
require 'kimurai'
# Use the Capybara based Kimurai web crawler to iterate through the YCDB.co data and populate an AirTable spreadsheet
class YCDBSpider < Kimurai::Base
@name = "example_spider"
@engine = :mechanize
Verifying my Blockstack ID is secured with the address 1oVAUqjZLsvvGCT3JmPcTNGF5VQqBTrw1 https://explorer.blockstack.org/address/1oVAUqjZLsvvGCT3JmPcTNGF5VQqBTrw1
@moflo
moflo / loremString - lorem ipsum string generator
Created April 13, 2017 16:55
JS ES6 Lorem Ipsum Random String Generator
var randomInt = (min,max) => { return Math.floor(Math.random() * (max - min + 1) + min) }
var loremString = (max) => {
let words = ['ad', 'adipisicing', 'aliqua', 'aliquip', 'amet', 'anim', 'aute', 'cillum', 'commodo', 'consectetur', 'consequat', 'culpa', 'cupidatat', 'deserunt', 'do', 'dolor', 'dolore', 'duis', 'ea', 'eiusmod', 'elit', 'enim', 'esse', 'est', 'et', 'eu', 'ex', 'excepteur', 'exercitation', 'fugiat', 'id', 'in', 'incididunt', 'ipsum', 'irure', 'labore', 'laboris', 'laborum', 'Lorem', 'magna', 'minim', 'mollit', 'nisi', 'non', 'nostrud', 'nulla', 'occaecat', 'officia', 'pariatur', 'proident', 'qui', 'quis', 'reprehenderit', 'sint', 'sit', 'sunt', 'tempor', 'ullamco', 'ut', 'velit', 'veniam', 'voluptate' ]
var sentence = ''
var count = max
while (count > 0) {
let i = randomInt(0,words.length)
let word = words[i]
sentence = count == max ? word : sentence+' '+word
count = count - 1
@moflo
moflo / MFBadgeButton
Created February 3, 2017 17:59
Swift add badge to UIButton - MFBadgeButton.swift
class MFBadgeButton : UIButton {
var badgeValue : String! = "" {
didSet {
self.layoutSubviews()
}
}
override init(frame :CGRect) {
@moflo
moflo / RealmORM.swift
Last active March 22, 2016 05:52
RealmORM, realm.io ORM in Swift 2.0 with simple CoreData like NSFetchController features, sorting Results<object> by a key
//
// RealmORM.swift
//
// Copyright © 2016 Mobile Flow LLC. All rights reserved.
//
import UIKit
import Realm
import RealmSwift
@moflo
moflo / ParseORM.swift
Created March 21, 2016 15:57
ORM to map Parse PFObject to native Swift 2.0 class structure, allowing easier migration from CoreData
//
// ParseORM.swift
//
// Copyright © 2016 Mobile Flow LLC. All rights reserved.
//
import UIKit
import Parse
class ParseORM : NSObject {
@moflo
moflo / TimeAgo.swift
Last active October 25, 2015 04:20 — forked from hansott/TimeAgo.swift
Time ago function swift ios cocoa
// MARK: - NSDate timeAgoSinceDate
// Updated for Swift2.0
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String {
let calendar = NSCalendar.currentCalendar()
let now = NSDate()
let earliest = now.earlierDate(date)
let latest = (earliest == now) ? date : now
let components:NSDateComponents = calendar.components([.Hour, .Minute, .Day, .WeekOfYear, .Month, .Year, .Second], fromDate: earliest, toDate: latest, options: [])
@moflo
moflo / ffielandingpage.html
Created September 12, 2011 23:57
IELandingPage
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="stylesheets/canvas.css" type="text/css" media="screen" />
<style type="text/css" media="screen">
#wrapper {width:100%;}
#wrapper p {width:80% !important;}