This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example of Geraldo Reports printing content above page header | |
1st page: | |
------ | |
| page header with content printed once | |
------ | |
| child band with normal page header content | |
------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Interesting pieces of code while I learn the language | |
import UIKit | |
func isPrime(number: Int) -> Bool { | |
let basicPrimes = [1,2,3,5,7,11,13,17,19] | |
let basicNonPrimes = [0,4,6,8,9,10,12,14,15,16,18,20] | |
if contains(basicPrimes, number) { | |
return true | |
} else if contains(basicNonPrimes, number) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calc_savings(years=10, monthly=500, rate=1.12, initial=0.): | |
""" | |
years = amount of years to saving money | |
monthly = amount saved per month (inflation is ignored) | |
rate = rate per year to apply. Must be 1 + annual interest rates | |
initial = initial amount to startup | |
""" | |
total = initial | |
for n in range(years): | |
total = (total + monthly * 12) * rate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Testing a Redux based action in Angular 2 app (using ng2-redux) | |
* More info: https://angular.io/docs/ts/latest/guide/testing.html#!#inject | |
*/ | |
import { TestBed, async, inject } from '@angular/core/testing'; | |
import { NgRedux } from 'ng2-redux'; | |
import { Observable } from 'rxjs'; | |
import { AppState } from '../../store'; | |
import { rootReducer } from '../../store/reducers'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable } from 'rxjs/Observable'; | |
import { ConnectableObservable } from 'rxjs/observable/ConnectableObservable'; | |
import { Subscription } from 'rxjs/Subscription'; | |
import { async } from 'rxjs/scheduler/async'; | |
/* This operator makes more sense when used with .publishReplay(1), as example below: | |
* | |
* let some$ = Observable.create(observer => { | |
* console.log(1110); | |
* observer.next('a value'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2016-10-21 04:06:05 Device API logging initialized - DEVICE | |
Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode. | |
EXCEPTION: Uncaught (in promise): TypeError: Cannot read property 'indexOf' of undefined | |
ORIGINAL STACKTRACE: | |
Error: Uncaught (in promise): TypeError: Cannot read property 'indexOf' of undefined | |
at resolvePromise (http://localhost:3000/polyfills.bundle.js:17988:31) | |
at http://localhost:3000/polyfills.bundle.js:18024:17 | |
at ZoneDelegate.invokeTask (http://localhost:3000/polyfills.bundle.js:17795:37) | |
at Object.onInvokeTask (http://localhost:3000/vendor.bundle.js:36127:37) | |
at ZoneDelegate.invokeTask (http://localhost:3000/polyfills.bundle.js:17794:42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author: @AngularClass | |
*/ | |
const webpack = require('webpack'); | |
const helpers = require('./helpers'); | |
const path = require('path'); | |
/** | |
* Webpack Plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// loaders (just the related ones) when icon fonts work but require('./file.css') don't | |
loaders: [ | |
// ... | |
{ | |
test: /\.scss$/, // this is here just for reference. I got no issues with sass files | |
loaders: ['to-string-loader', 'css', 'sass'] | |
}, | |
{ | |
test: /\.css$/, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const | |
webpack = require('webpack'), | |
path = require('path'), | |
fileSystem = require('fs'), | |
helpers = require('./config/helpers'), | |
HtmlWebpackPlugin = require('html-webpack-plugin'), | |
ExtractTextPlugin = require('extract-text-webpack-plugin'), | |
CopyWebpackPlugin = require('copy-webpack-plugin'); | |
module.exports = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xs from 'xstream'; | |
import { run } from '@cycle/xstream-run'; | |
import { makeDOMDriver, div } from '@cycle/dom'; | |
// import { Observable } from 'rxjs/Observable'; | |
const | |
html = require('./panel.html'), | |
css = require('./panel.css'); | |
function main() { |
OlderNewer