Skip to content

Instantly share code, notes, and snippets.

Avatar
🐭
Happy Days

Jake Lacey jakelacey2012

🐭
Happy Days
View GitHub Profile
@jakelacey2012
jakelacey2012 / testing.go
Created Aug 6, 2017
Example of testing in go
View testing.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 Aug 3, 2017
A query generator to test graphql servers.
View graphql-schema-recursion.js
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 Nov 18, 2016
node docker & docker-compose
View Dockerfile
FROM node:4.6.1
RUN npm install nodemon -g
ADD ./src ./src
ADD ./package.json ./package.json
ADD ./.babelrc ./.babelrc
ADD ./config ./config
View ExampleTests.js
/**
* contactUs
*/
import { Router } from 'meteor/lib-flow';
if (Meteor.isServer) return;
/**
* Simple Test to check the title of contact us
*/
describe('Contact Us', function () {
View ObjectCopying.js
/**
* Object copying with no mutation.
*/
console.log('Test ObjectASssign');
const x = {
name: 'Will',
age: 35,
hair: {
View Phantomjs-ClientSide
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
View MT.js
// 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--------------------------------');
View modalUseful.js
//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)
}
View Global-iris.html
<!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">
View track_user_login.php
<?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(
You can’t perform that action at this time.