<commit_before>import fs from 'fs'
import rc from 'rc'
import ini from 'ini'
import path from 'path'
import mkdirp from 'mkdirp'
import untildify from 'untildify'

const conf = rc('tickbin', {
  api: 'http://localhost:8080/',
  local: '~/.tickbin'
})

conf.local = untildify(conf.local)
conf.db = path.join(conf.local, 'data')

if (!fs.existsSync(conf.local)) {
  mkdirp.sync(conf.local)
}

function setConfig(key, value) {
  let parsed = {}
  let target = conf.config || untildify('~/.tickbinrc')
  if (conf.config) parsed = ini.parse(fs.readFileSync(target, 'utf-8'))
  parsed[key] = value
  fs.writeFileSync(target, ini.stringify(parsed))
}

export { setConfig }
export default conf<commit_msg>Update to point to production server api<commit_after>import fs from 'fs'
import rc from 'rc'
import ini from 'ini'
import path from 'path'
import mkdirp from 'mkdirp'
import untildify from 'untildify'

const conf = rc('tickbin', {
  api: 'https://api.tickbin.com/',
  local: '~/.tickbin'
})

conf.local = untildify(conf.local)
conf.db = path.join(conf.local, 'data')

if (!fs.existsSync(conf.local)) {
  mkdirp.sync(conf.local)
}

function setConfig(key, value) {
  let parsed = {}
  let target = conf.config || untildify('~/.tickbinrc')
  if (conf.config) parsed = ini.parse(fs.readFileSync(target, 'utf-8'))
  parsed[key] = value
  fs.writeFileSync(target, ini.stringify(parsed))
}

export { setConfig }
export default conf
{'fraction_non_alphanumeric': 0.15530569219957835, 'fraction_numerical': 0.004216444132115249, 'mean_word_length': 4.628458498023716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6762478', 'n_tokens_mistral': 519, 'n_tokens_neox': 509, 'n_words': 129}