Skip to content

Instantly share code, notes, and snippets.

View jakelacey2012's full-sized avatar
🐭
Happy Days

Jake Lacey jakelacey2012

🐭
Happy Days
View GitHub Profile
@jakelacey2012
jakelacey2012 / testing.go
Created August 6, 2017 18:48
Example of testing in go
package sum
// Ints returns sum of list integers.
func Ints(vs ...int) int {
return ints(vs)
}
func ints(vs []int) int {
if len(vs) == 0 {
return 0
@jakelacey2012
jakelacey2012 / graphql-schema-recursion.js
Created August 3, 2017 09:05
A query generator to test graphql servers.
if (!process.argv[2]) process.exit();
const generateQuery = (iter) => {
if (iter === 0) {
return ` x { y { yAttribute } } `;
} else {
return ` x { y { ${generateQuery(iter - 1)} } }`;
}
@jakelacey2012
jakelacey2012 / Dockerfile
Created November 18, 2016 19:59
node docker & docker-compose
FROM node:4.6.1
RUN npm install nodemon -g
ADD ./src ./src
ADD ./package.json ./package.json
ADD ./.babelrc ./.babelrc
ADD ./config ./config
/**
* contactUs
*/
import { Router } from 'meteor/lib-flow';
if (Meteor.isServer) return;
/**
* Simple Test to check the title of contact us
*/
describe('Contact Us', function () {
/**
* Object copying with no mutation.
*/
console.log('Test ObjectASssign');
const x = {
name: 'Will',
age: 35,
hair: {
// const SLIMER_SCRIPT = '/home/jlacey/Documents/workspace/optiq/optiq/packages/zombie/server/slimer-script.js';
const SLIMER_SCRIPT = 'server/slimer-script.js';
function startZombie(done) {
const slimerProcess = childProcess.execFile(
Slimer.path, [Assets.absoluteFilePath( SLIMER_SCRIPT )],
function (err, stdout, stderr) {
console.log('\n--------------------------------');
I20161019-08:58:09.251(1)? 2016-10-19T08:58:09 [CRITICAL] QNetworkReplyImpl: backend error: caching was enabled after some bytes had been written
I20161019-08:58:09.429(1)? TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
I20161019-08:58:09.429(1)?
I20161019-08:58:09.429(1)? phantomjs://code/phantomjsScript.js:15 in onError
I20161019-08:58:09.430(1)? http://localhost:3400/packages/promise.js?hash=2d5b025794b9c9e54e5cf6bea71c642ef921a2ed: 17
I20161019-08:58:09.430(1)?
I20161019-08:58:09.430(1)? phantomjs://code/phantomjsScript.js:17
I20161019-08:58:09.431(1)? TypeError: undefined is not an object (evaluating 'Package.modules.meteorInstall')
I20161019-08:58:09.431(1)?
I20161019-08:58:09.431(1)? phantomjs://code/phantomjsScript.js:15 in onError
//observe changes so that when elements in the modal,
// change the modal size will also change
modal (...args) {
this.$modal.modal({observeChanges: true}).modal(...args)
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Standard Life - Payments Page</title>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="desktopresources/css/styles.css">
<?php
/**
* Helper function to insert the user thats logged in
* to the database
*/
function JwLanalytics_track_user_data_login($uid) {
try {
$timestamp = time();
db_insert('users_logins_data')
->fields( array(