This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function UserPage({ currentUser, user }: PageProps<{ user: User }>) { | |
return ( | |
<Page title={user.name}> | |
<div className="flex flex-row items-center gap-2"> | |
<Avatar url={user.avatarUrl} /> | |
<span className="font-bold">{user.name}</span> | |
{user.id === currentUser?.id && ( | |
<a href={`/users/${user.id}/edit`}>Edit</a> | |
)} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { readFileSync } = require('fs'); | |
const oldPkgPath = | |
'/Users/nickcherry/src/nickcherry/farcaster-monorepo/apps/farcaster-mobile/package.json'; | |
const pkg = JSON.parse(readFileSync(oldPkgPath, 'utf-8')); | |
console.log( | |
`yarn add --dev ${Object.keys(pkg.devDependencies) | |
.filter((dep) => !['sharp-cli'].includes(dep)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lonelyInteger(arr) { | |
return arr.reduce((acc, n) => acc ^ n); | |
} | |
const arr = [1, 4, 1, 2, 3, 4, 3]; | |
console.log(lonelyInteger(arr)); | |
// 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*************************************************************************************/ | |
/* Import Dependencies */ | |
/*************************************************************************************/ | |
const { mapSeries } = require('async'); | |
const axios = require('axios'); | |
const fs = require('fs'); | |
const { chain, flatten, sortBy, sortedUniqBy } = require('lodash'); | |
const moment = require('moment'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Balance | |
attr_accessor :person, :amount | |
def initialize(person, amount) | |
@person, @amount = person, amount | |
end | |
def to_s | |
"#{ person }: #{ amount }" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const classifier = new BayesClassifier(); | |
classifier.train('BarackObama', 'Fighting climate change with solar power creates jobs.'); | |
classifier.train('elonmusk', 'Turns out ExxonMobil not 100% forthcoming about climate change'); | |
classifier.train('elonmusk', 'Yeah, climate change should really be considered a centrist issue, as it affects everyone.'); | |
classifier.stemCounts | |
/* | |
{ | |
'100': 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
nil => 1092, | |
"Android 1" => 2, | |
"Android 38" => 1, | |
"Android 4" => 3, | |
"Chrome 28" => 1, | |
"Chrome 32" => 1, | |
"Chrome 35" => 15, | |
"Chrome 36" => 151, | |
"Chrome 38" => 3, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
nil => 5007, | |
"Android 1" => 2, | |
"Android 2" => 1, | |
"Android 36" => 35, | |
"Android 38" => 1, | |
"Android 39" => 3, | |
"Android 4" => 4, | |
"Android 40" => 1, | |
"Android 43" => 5, |
NewerOlder