Skip to content

Instantly share code, notes, and snippets.

View jjhesk's full-sized avatar
🌸
focusing on DRL

SodiDav jjhesk

🌸
focusing on DRL
  • ZZY
  • 1601 McCarthy Blvd, Milpitas, CA 95035, US
View GitHub Profile

#How to Construct Yourself UI in KeystoneJS

KeystoneJS provide Admin UI with one set of route controllers and view templates(list&item) for all of the models.But usually,you will need some custome views other than Admin UI to display models. Although the KeystoneJS documention don't tell us much about how to contruct custome view,we can learn this from the source code in skeleton project generated by yo keystone,or you can just check out the keystone demo project's source code.We will walk through the blog feature's implementation in this demo application to demonstrate how to construct custome UI in KeystoneJS application.

As KeystoneJS documention described in Routes & Views section,there is a routes/index.js file, where we bind application's URL patterns to the controllers that load and process data, and render the appropriate template.You can find following code in it:

app.get('/blog/:catego

'''
BEGIN GPL LICENSE BLOCK
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@jjhesk
jjhesk / README.md
Created November 13, 2015 03:33 — forked from polbins/README.md
Android Response Caching using Retrofit 1.9 + OkHttp 2.2

Android REST Controller with Cache-Control

Android REST Controller with Simple Cache Control Headers using Retrofit 1.9.0 + OkHttp 2.2.0

@jjhesk
jjhesk / include_list_viewpager.xml
Created April 21, 2016 10:13 — forked from iPaulPro/include_list_viewpager.xml
CollapsingToolbarLayout with TabLayout
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
const WS = require('ws')
const _ = require('lodash')
const async = require('async')
const fs = require('fs')
const moment = require('moment')
const pair = process.argv[2]
const conf = {
wshost: "wss://api.bitfinex.com/ws/2"
@jjhesk
jjhesk / TetherToken.sol
Created February 2, 2018 13:10 — forked from plutoegg/TetherToken.sol
TetherToken.sol - Tether.to USD
pragma solidity ^0.4.11;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
@jjhesk
jjhesk / TetherToken.sol
Created February 2, 2018 13:10 — forked from plutoegg/TetherToken.sol
TetherToken.sol - Tether.to USD
pragma solidity ^0.4.11;
/**
* Math operations with safety checks
*/
library SafeMath {
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
@jjhesk
jjhesk / High-Stakes Roulette Example
Created February 20, 2021 08:14 — forked from gorgos/High-Stakes Roulette Example
Example for a contract for playing high-stakes Roulette on the blockchain
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract BankOwned {
address public bankAddress;
constructor() {
bankAddress = msg.sender;
}