Skip to content

Instantly share code, notes, and snippets.

View zenithtekla's full-sized avatar

ZeTek zenithtekla

  • Fictitious(FBN): ZetekLA
  • pristinekallio@gmail.com
View GitHub Profile
Running "mochaTest:src" (mochaTest) task
Article Model Unit Tests:
Method Save
✓ should be able to save without problems (76ms)
✓ should be able to show an error when try to save without title
Article CRUD tests
✓ should be able to save an article if logged in (275ms)
@zenithtekla
zenithtekla / back-end.md
Last active August 20, 2016 23:58
back-end development

To be fair, PHP does have a composer/compiler called composer.PHAR and it does incorporate PEAR somehow but it is difficult to manipulate/tweak it to inject task runner, build script (like Grunt/Gulp/Webpack be invoked in Javascript webdev env). It is difficult because lack of knowledge of core PHP and hard to do without touching core PHP/ PHP fundamentals incorporated in the PHAR file.

I have some practice with NodeJS (MEAN stack) and currently looking at Meteor. Both have the capability to perform desktop and mobile web development.

  • For NodeJS, there are atom-shell and node-webkit allow packing of Chromimum lite so the webApp can run as a desktop application, high portability and with data encapsulation layers: mongoose (for MongoDB) and sequelize (for MySQL, Postgre, SQLite)
  • Meteor has built-in function to package a desktop version of the webapp. Like Ionic-Cordova, Redux, both NodeJS and Meteor are able to have the apps deployable on mobile platforms. But learning some Java with Android studio would
@zenithtekla
zenithtekla / settings.txt
Last active August 24, 2016 05:35
Ubuntu tweaks
[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
greeter-show-manual-login=true
=================
[Seat:*]
autologin-guest=false
autologin-user=pristine
@zenithtekla
zenithtekla / app.js
Last active August 29, 2016 16:54
Express-Header
[express/connect.static] Set ‘Last-Modified’ to now to avoid 304 Not Modified
OCTOBER 12, 2011 KONSTANTIN VLASENKOLEAVE A COMMENT
Why do I need this? The right answer is: I don’t need that trick!
The example below is just to show how to use routes to intercept requests to a static file.
Put router before static.
app.use(app.router);
app.use(express.static(__dirname + '/static'));
@zenithtekla
zenithtekla / bookmark.html
Created September 1, 2016 04:06
save 08/31
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body { font-family:helvetica,arial,sans-serif; font-size:13px; }
h1 { color:hsl(0, 0%, 40%); background:#eee; margin:20px 10px 0; padding:10px; border-radius:2px; font-weight:normal; font-size:17px; }
h2 { color:hsl(0,0%,33%); margin-left:25px; margin-top:20px; font-weight:normal; font-size:15px; }
li { white-space:nowrap; padding:3px 0; }
a { text-decoration:none; vertical-align:middle; color:black; }
@zenithtekla
zenithtekla / ecms.js
Last active February 2, 2018 17:24
ECMS
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Schema
*/
var Schema1 = new Schema({
asset_number: String,
last_cal: Date,
@zenithtekla
zenithtekla / r7.patch
Created September 16, 2016 22:30
Git added Gateway for MantisBT
if( config_get_global( 'wiki_enable' ) == ON ) {
$t_menu_options[] = '<a href="' . helper_mantis_url( 'wiki.php?type=project&amp;id=' ) . $t_current_project . '">' . lang_get( 'wiki' ) . '</a>';
}
+ $t_username = current_user_get_field( 'username' );
+ $t_realname = current_user_get_field( 'realname' );
+ // $t_menu_options[] = '<a href="' . helper_mantis_url( 'manuke.php?user=' . $t_username .'&amp;user_id='.auth_get_current_user_id().';hashed_password=' ) . auth_get_current_user_id() . '" title="Gateway to external application(done in either Python, Java, Ruby, NodeJS, or MeteorJS)">' . Manuke . '</a>';
+ $t_menu_options[] = '<a href=http://esp21:3033/?user=' . $t_username .'&amp;user_id='.auth_get_current_user_id().';hashed_password=will_be_added' . ' title="Gateway to external application(done in either Python, Java, Ruby, NodeJS, or MeteorJS)">' . Manuke . '</a>';
# Plugin / Event added options
$t_event_menu_options = event_signal( 'EVENT_MENU_MAIN' );
@zenithtekla
zenithtekla / data.js
Created September 19, 2016 20:35
for NodeMYSQL
{ "query_text": "UPDATE `mantis_query_manex_sync_table` SET `query_text`='UPDATED' WHERE `id` = '1'", "status":1 }
@zenithtekla
zenithtekla / loadScript.js
Last active October 28, 2016 20:24
Improvement on the loadScript, still not working with AngularJS
'use strict';
// src: https://github.com/zenithtekla/mantisbt/blob/r6/plugins/UTILS_plugin/bower_components/mantis_extended_kernel/client/js/buildscript.js
// further ref: http://stackoverflow.com/a/950146/5828821
var loadScript = function(arr){
var loaded = [];
var ignored = [];
for (var i = 0; i < arr.length; i++) {
var _ = arr[i];
@zenithtekla
zenithtekla / vendor.ts
Created November 1, 2016 18:58
Bundling vendor
import './node_modules/systemjs/dist/system.js';
import './node_modules/rxjs/bundles/Rx.js';
import './node_modules/angular2/bundles/angular2-polyfills.min.js';
import './node_modules/angular2/bundles/angular2.js';
import './node_modules/angular2/bundles/http.js';
import './node_modules/angular2/bundles/router.js';
import './node_modules/angular2/es6/dev/src/testing/shims_for_IE.js';