Skip to content

Instantly share code, notes, and snippets.

@import "globals.j"
//@import "WordsController.j"
@implementation LessonsController : CPObject
{
JSObject objs @accessors;
JSObject dataObject;
@outlet CPScrollView lessonsScrollView;
@outlet CPTableView lessonsTableView;
@outlet CPLabel appLabel;
@conniec
conniec / add_sites_domain.py
Created February 3, 2012 23:05
add sites to a custom domain
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)
@conniec
conniec / gist:3014061
Created June 28, 2012 21:32
fisher email notifications
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 = {
@conniec
conniec / gist:3056989
Created July 5, 2012 23:02
disable gravatar
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)
@conniec
conniec / gist:3079954
Created July 10, 2012 00:07
village voice delete conv
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)
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,
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)
@conniec
conniec / Cats.scala
Last active October 5, 2017 00:19
Free Monad example with Cats and Scalaz
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]
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
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