Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Coding

Martin Alix malixsys

💻
Coding
View GitHub Profile
View Wait.tests.js
describe('DiscoverQuery', () => {
let called;
let deferred;
let oldFetch;
beforeEach(() => {
called = defer();
deferred = defer();
oldFetch = window.fetch;
window.fetch = jest.fn().mockImplementation(async () => {
@malixsys
malixsys / tryEthereum.js
Created Apr 1, 2018 — forked from qx133/tryEthereum.js
Try out Ethereum using only nodejs and npm!
View tryEthereum.js
var Web3 = require('web3');
var util = require('ethereumjs-util');
var tx = require('ethereumjs-tx');
var lightwallet = require('eth-lightwallet');
var txutils = lightwallet.txutils;
var web3 = new Web3(
new Web3.providers.HttpProvider('https://rinkeby.infura.io/')
);
var address = '0x8D68583e625CAaE969fA9249502E105a21435EbF';
var key = '1ce642301e680f60227b9d8ffecad474f15155b6d8f8a2cb6bde8e85c8a4809a';
@malixsys
malixsys / flatten.js
Created Feb 28, 2018 — forked from anonymous/flatten.js
An array flattener
View flatten.js
/**
* @param arr the array to flatten
* @param ret used internally, a starting point if passed
* @returns {Array} a flattened array such that `. [[1,2,[3]],4] -> [1,2,3,4]`
* @example
* const flatten = require('./flatten');
* console.warn(flatten([1, [2, [3, [4]], 5]]));
* // [1, 2, 3, 4, 5]
*/
const flatten = (arr, ret = []) => {
@malixsys
malixsys / INSTALLATION.md
Created Jan 20, 2016 — forked from DenisIzmaylov/INSTALLATION.md
DigitalOcean Dokku: fresh install with Node.js Environment
View INSTALLATION.md

DigitalOcean Dokku / Node.js Cloud Environment

Custom recipe to get full Node.js Cloud Environment in DigitalOcean Dokku droplet running from scratch. Yes. Your own Heroku for $5 per month.

I use this gist to keep track of the important configuration steps required to have a functioning system after fresh install.

When you have executed that's all step by step you will get a new working and stable system which is ready to host & serve your Node.js application and databases.

View BuildAndDeploy.MD

CDS

These instructions assume a Kurios MEP/MEPP on 2015/09/11. Vary accordingly.

BUILDING

  1. Get latest dev and main
  2. Merge dev to main
  3. Open $/CDS1022/Kurios/main/src/Cds.Marketing.Kurios.sln
  4. Build the solution to make sure it build correctly and check it in
View example.html
<form novalidate="novalidate" on-valid-submit="updateUser()">
<div class="list list-inset">
<div class="item">
<h2>{{'edit profile'|i18n}}</h2>
</div>
<label class="item item-input validated">
<span class="input-label">{{ 'full name' | i18n}}:</span>
<input type="text" ng-model="user.fullname" id="fullname" name="fullname" required="required"
ng-pattern="/^[^$%]{3,255}$/"
/>
@malixsys
malixsys / PaymentService.js
Last active Sep 3, 2015
Beanstream with Angular and Node
View PaymentService.js
'use strict';
angular.module('app')
.factory('PaymentService', ['$http', '$q', 'Scripts', function($http, $q, Scripts) {
function parseExpiry(value) {
var month, prefix, year, _ref;
value = value || '';
View Main Gulp
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var lr = require('tiny-lr');
var server = lr();
var browserify = require('gulp-browserify');
var spawn = require('child_process').spawn;
var rename = require('gulp-rename');
var plumber = require('gulp-plumber');
@malixsys
malixsys / gulpfile.js
Created Feb 28, 2014
Express AngularJS Browserify Gulpfile
View gulpfile.js
'use strict';
/**
* Module dependencies
*/
var gulp = require('gulp');
var gutil = require('gulp-util');
var lr = require('tiny-lr');