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 "globals.j" | |
//@import "WordsController.j" | |
@implementation LessonsController : CPObject | |
{ | |
JSObject objs @accessors; | |
JSObject dataObject; | |
@outlet CPScrollView lessonsScrollView; | |
@outlet CPTableView lessonsTableView; | |
@outlet CPLabel appLabel; |
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 lfcore.domain.api import DomainAPI | |
#Change the subdomain name and filename of sites | |
#Filename of sites should be list of sites, one on each line | |
subdomain = 'fisher-1' | |
sitefile = open("/tmp/list.txt", 'r') | |
d = Domain.objects.get(name='rooms.%s.fyre.co' % subdomain) | |
print "Domain: "+str(d) |
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 lfcore.ident.api import IdentAPI | |
import time | |
d = Domain.objects.get(name="rooms.fisher-0.fyre.co") | |
#d = Domain.objects.get(pk=5) | |
#all_users = UserProfile.objects.filter(domain=d)[:20] | |
all_users = UserProfile.objects.filter(domain=d, state=RowState.enums().ENABLED) | |
site = Site.objects.filter(domain=d)[0] | |
data = { |
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 lfcore.ident.api import IdentAPI | |
import time, datetime | |
def disable_gravatar(domain_name): | |
throttle = 0.07 | |
start_time = datetime.datetime.now() | |
d = Domain.objects.get(name=domain_name) | |
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 lfcore.conv.api import ConvAPI | |
def delete_conv(conv_id): | |
c = Conv.objects.get(pk=conv_id) | |
ConvAPI.delete_conv(c, c.owner, mangle=True) | |
delete_conv(12213921) | |
delete_conv(12220145) |
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 matplotlib.pyplot as plt | |
fig = plt.figure() | |
ax = fig.add_subplot(1,1,1) | |
log = [51.45, | |
68.35, | |
77.9, | |
85, | |
85.15, |
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
scala> import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.ExecutionContext.Implicits.global | |
scala> import GetTicketsExample._ | |
import GetTicketsExample._ | |
scala> result | |
res0: scala.concurrent.Future[String] = null | |
scala> result.foreach(println) |
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 cats.free.Free | |
import cats.~> | |
import cats._, cats.std.all._ | |
import cats.Functor | |
// https://github.com/non/cats/blob/master/docs/src/main/tut/freemonad.md | |
sealed trait Command[+Next] | |
case class Person(name: String) extends AnyVal | |
case class Push[Next](person: Person, next: Next) extends Command[Next] |
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 cats.data.EitherT | |
import cats.data.Validated | |
import cats.implicits._ | |
// def ap[A, B](f: F[A => B])(fa: F[A]): F[B] | |
val l1: EitherT[Option, String, Int] = EitherT.left(Some("error 1")) | |
val r1: EitherT[Option, String, Int => String] = EitherT.right(Some(f)) | |
val r2: EitherT[Option, String, Int] = EitherT.right(Some(10)) | |
val f: Int => String = i => (i * 2).toString |
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
14:28:45.733 [kafka-streams-test-service-akka.actor.default-dispatcher-4] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started | |
14:28:45.971 [main] INFO o.apache.kafka.streams.StreamsConfig - StreamsConfig values: | |
application.id = map-function-scala-example | |
application.server = | |
bootstrap.servers = [localhost:9092] | |
buffered.records.per.partition = 1000 | |
cache.max.bytes.buffering = 10485760 | |
client.id = | |
commit.interval.ms = 30000 | |
connections.max.idle.ms = 540000 |
OlderNewer