Skip to content

Instantly share code, notes, and snippets.

Avatar

Raif Harik reharik

View GitHub Profile
View controllerFunction.js
async activity(ctx) {
let activitySql = path.join(__dirname,`./../repositories/sql/activity.sql`);
let activity = await repository(activitySql,'get_activity_by_id', ctx.params);
ctx.status = 200;
ctx.body = {
status: ctx.status,
success: true,
data: activity
};
View controllerFunction.js
async activity(ctx) {
let activitySql = path.join(__dirname,`./../repositories/sql/activity.sql`);
let activity = await repository(activitySql,'get_activity_by_id', ctx.params);
ctx.status = 200;
ctx.body = {
status: ctx.status,
success: true,
data: activity
};
View webpack.config.js
.
├── example
│   ├── components
│   │   ├── App.js
│   │   └── DevTools.js
│   ├── reducers
│   │   └── index.js
│   ├── store
│   │   └── configureStore.js
│   ├── index.js
View pivot.js
[
{ day:'wednesday',
events: [{
time: "7:00 AM",
task: 'do something'}
]},
{ day:'wednesday',
events: [{
time: "8:00 AM",
taks : 'do something'}
View gist:8a63035380d13bb9e8b2145c48b6b946
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var node_modules = __dirname + '/node_modules';
const config = {
// Gives you sourcemaps without slowing down rebundling
devtool : 'cheap-module-eval-source-map',
resolve: { alias: {} },
View gist:a0b3ae943208a57bf812d15fdc1e06ec
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
nl UNCONN 0 0 rtnl:kernel *
nl UNCONN 4352 0 tcpdiag:ss/95 *
nl UNCONN 768 0 tcpdiag:kernel *
nl UNCONN 0 0 9:kernel *
nl UNCONN 0 0 10:kernel *
nl UNCONN 0 0 15:kernel *
nl UNCONN 0 0 16:kernel *
tcp LISTEN 0 128 127.0.0.1:http-alt
View gist:079cd7849bb0a8ca5ff01d29a4aea96f
[
{
"Id": "f5b0c4a11f0eb23d02d2f7999ec88d0b209e7ee92cbe9929c2c723c0d7c54755",
"Created": "2016-05-25T14:48:53.141597145Z",
"Path": "npm",
"Args": [
"start"
],
"State": {
"Status": "running",
View gist:10cb998ac74b5d72aa8e2d54872c7954
const reducers = combineReducers({
routing,
chapters: (state = {}) => state,
expandChapter
});
export default reducers;
const expandChapter = (state = {}, action = null) => {
View gist:4abb0133dc50e76964d3f13031cf2a21
const { connect } = require('react-redux');
module.exports = (storeKeys = [], transform, actions) => (component) => {
transform = transform || ((dataFromStore) => { return dataFromStore});
const mapStateToProps = (state, ownProps) => {
const storeDataObjs = storeKeys.map(key => ({ [key]: state[key] }));
const storeObj = Object.assign({}, ...storeDataObjs);
return transform(storeObj, ownProps);
View gist:dedfd1a40b245429d2d84369657de5ae
courses:{
1:{
lastUpdated: '',
id: 1,
courseTitle: 'course title 1',
active: true,
chapters: [1]
},
2:{
lastUpdated: '',
You can’t perform that action at this time.