View query_customer_feedback.py
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 os | |
import logging | |
import sys | |
import textwrap | |
from llama_index import ( | |
GPTKeywordTableIndex, | |
SimpleDirectoryReader, | |
LLMPredictor, | |
) |
View inspect_team_retention.py
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
from datetime import datetime | |
from csv import DictWriter | |
from cStringIO import StringIO | |
from parts.util.encoding import ensure_str | |
from twist.init import init_twist | |
init_twist(EXPOSE_MODULES=False) | |
from twist.models.database import main_db, close_current_connections |
View Example Return.json
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
{ | |
"title": "Growth numbers for April 2017", | |
"content": "Hi team,\nThese are our growth numbers for **April 2017**...", | |
} |
View appear_applet.py
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
# -*- coding: utf-8 -*- | |
""" | |
Start video conversations from Twist by just typing `/appear room-name` | |
""" | |
from flask import Flask | |
from flask import jsonify | |
from flask import request | |
app = Flask(__name__) |
View sorts.py
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
# Rewritten code from /r2/r2/lib/db/_sorts.pyx | |
from math import sqrt | |
def _confidence(ups, downs): | |
n = ups + downs | |
if n == 0: | |
return 0 | |
z = 1.281551565545 |
View bitmapist_gen_html_data.py
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
from bitmapist import cohort | |
dates_data = cohort.get_dates_data(select1='user:active', | |
select2='task:complete', | |
select3=None, | |
time_group='days') | |
html_data = cohort.render_html_data(dates_data, | |
time_group='days') |
View bitmapist_gen_html_form.py
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
from bitmapist import cohort | |
html_form = cohort.render_html_form( | |
action_url='/_Cohort', | |
selections1=[ ('Are Active', 'user:active'), ], | |
selections2=[ ('Task completed', 'task:complete'), ] | |
) | |
print html_form |
View gist:88cc073049c1aba5c6af
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
# Store | |
class CounterStore extends EventEmitter | |
constructor: -> | |
@count = 0 | |
@dispatchToken = @registerToDispatcher() | |
increaseValue: (delta) -> | |
@count += 1 |
View gist:2b492d7e778da9ee4231
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 ModelCounter | |
constructor: (@value=1) -> | |
increaseValue: (delta) => | |
@value += delta | |
class ControllerCounter | |
constructor: (opts) -> |
View gist:f15508ac6a8b534c3290
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
-- List functions | |
-- | |
-- | |
LIST_DELIM = "~" | |
function list_add(key, value) | |
--- Determine the limit by inspecting if | is in the key | |
local limit = 200 | |
if string.find(key, '|') then |
NewerOlder