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
@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 / 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 / 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 / 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 / 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 / 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
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)
Warning: a promise was created in a handler but was not returned from it
at Model.findAll (C:\Users\PhucTran\seanjs\node_modules\sequelize\lib\model.js:1347:18)
at Model.findOne (C:\Users\PhucTran\seanjs\node_modules\sequelize\lib\model.js:1519:34)
at exports.userByID (C:\Users\PhucTran\seanjs\modules\users\server\controllers\users\user.authorization.server.controller.js:20:8)
at paramCallback (C:\Users\PhucTran\seanjs\node_modules\express\lib\router\index.js:404:7)
at null.<anonymous> (C:\Users\PhucTran\seanjs\modules\users\server\controllers\admin.server.controller.js:140:7)
at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
at Promise.then (C:\Users\PhucTran\seanjs\node_modules\sequelize\lib\promise.js:21:17)
at exports.userByID (C:\Users\PhucTran\seanjs\modules\users\server\controllers\admin.server.controller.js:121:21)
@zenithtekla
zenithtekla / prototypal programming.js
Last active July 20, 2016 18:30
prototypal programming
/*
var productCategoryRouteConf = {
app: '',
routeTable: [],
// later all we add these
init : function(){},
addRoutes: function(){}
}
*/
@zenithtekla
zenithtekla / git.bash
Last active July 17, 2016 05:45
Some git commands
Deleting last commit
$ git reset HEAD^ --hard
$ git push -f origin master
$ git cherry-pick <rev-hash>
# Proceed with git push if shell message seems fine, Otherwise do git commit to ascertain if there are changes in files
# and resolve with git add, rm.
$ git commit
$ git push -f origin <branch|master>