Skip to content

Instantly share code, notes, and snippets.

View jkdeveyra's full-sized avatar

JK de Veyra jkdeveyra

  • Pocketmath
  • Singapore
View GitHub Profile
/**
* Campaign Templates collection.
*/
CampaignTemplates = new Meteor.Collection('campaign_templates');
var CategorySchema = new SimpleSchema({
"name": { type: String },
"code": { type: String },
"type": { type: String },
"values": { type: [String] }
Feature: Search campaigns
Background:
Given user is logged in
* all campaigns are removed
* campaigns exists:
| Title | Approved |
| Presidential Campaign | true |
| Campaign 1 | true |
| Campaign Summer | false |
Feature: Search campaigns
Background:
Given user is logged in
* all campaigns are removed
* campaigns exists:
| Name | Enabled |
| Presidential Campaign | true |
| Campaign 1 | true |
| Campaign Summer | false |
Feature: Display Headlines
# Related tickets: HAT-189
Scenario Outline: Show list of categories in headline
Given user is logged in
* all campaigns are unapproved
* approved campaign exists with details:
| Title | Campaign 1 |
| Start Date | 01/01/2015 |
| End Date | 12/31/2015 |
@jkdeveyra
jkdeveyra / 1.sql
Last active August 29, 2015 14:20
225 Hour Training Reminder with free HYTV
select a.* from (
select ac.contact_id, a.* from civicrm_activity a
join civicrm_activity_contact ac on ac.activity_id=a.id and ac.record_type_id = 3
join civicrm_option_value v on v.value=a.activity_type_id and v.option_group_id = 2 and v.name like '%225 Download Packet%'
join civicrm_contact c on c.id = ac.contact_id
where c.is_deleted = 0
) as a
LEFT JOIN
(
select ac.contact_id from civicrm_activity a
@jkdeveyra
jkdeveyra / ERCForest.scala
Last active August 29, 2015 13:57
ERC Forest
case class ERCForestConf(nbTrees: Int = 8, treeConf: ERCTreeConf = ERCTreeConf())
case class ERCForest(trees: IndexedSeq[ERCTree]) {
def assignIndexSeq(pt: Seq[Seq[Float]]): Seq[Int] = {
trees.map(_.query(pt)).flatten
}
def numClusters = trees.map(_.leavesSize).sum
}
int ans, i;
for (i = 1; i < 6; i++) {
ans = i % 2;
if (ans == 1)
System.out.print(i + 1)
}
int x = 7 + 3 * 6 / 2 - 1;
System.out.println(x);
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "SubProjectExample"
val appVersion = "1.0-SNAPSHOT"
val core = Project("core", file("core"))
def sentenceAnagrams(sentence: Sentence): List[Sentence] = {
def subSentence(occ: Occurrences): List[Sentence] = {
if (occ.isEmpty) List(List())
else
for {
x <- combinations(occ)
y <- dictionaryByOccurrences(x)
z <- subSentence(subtract(occ, x))
} yield y :: z
/**
* This program shows how to store tabular data in a 2D array.
*
* @version 1.40 2004-02-10
* @author Cay Horstmann
*/
public class CompoundInterest {
public static void main(String[] args) {
final double STARTRATE = 10;
final int NRATES = 6;