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

@jjhesk
jjhesk / server setup
Created October 6, 2015 06:48
Hi Folks, I have build a realtime notification app using Django(1.8.5). I am using django server, Nodejs as push server, ishout.js[nodejs+redis +express.js API]. So I installed them by following the instructions. Kindly suggest how following errors can be fixed : Error:1). Now when I am doing "$ python manage.py shell" , i get this error http://…
(global)aruns (master *) realtimenotif $ python manage.py shell
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.auth.models import User
>>> u = User(first_name="Arun",username='arun').save()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/aruns/global/local/lib/python2.7/site-packages/django/db/models/base.py", line 734, in save
'''
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 / particles
Created October 31, 2015 05:07
particles system
import java.util.Random;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Handler;
import android.os.Message;
import android.view.SurfaceHolder;
<style type="text/css"><!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
<body>
<div id="disqus_thread"></div>
<script type="text/javascript">
var params;
var disqus_url="http://hypetrak.com/2015/11/tbd-jay-electronica-jai-paul-and-the-allure-of-the-unreleased-masterpiece/";
@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 / redirection pie google app
Created January 14, 2016 08:03
this google app script is to build the redirection pie Uri
function httpredirectpie(url) {
var options = {
headers:{
"Accept":"application/json",
"X-Api-version":"2.0"
},
muteHttpExceptions: true,
followRedirects: false
};
var responose = UrlFetchApp.fetch(url, options);
@jjhesk
jjhesk / reflection_tween.cs
Created February 10, 2016 17:10
reflection problem issue
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[RequireComponent (typeof(LineRenderer))]
public class RaycastReflectionGameCom : MonoBehaviour
{
//this game object's Transform
private Transform goTransform;
//the attached line renderer
@jjhesk
jjhesk / FollowTrackingCamera.cs
Created February 10, 2016 17:41
Follow Tracking Camera
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class FollowTrackingCamera : MonoBehaviour
{
// Camera target to look at.
public Transform target;
private Transform check_target;
// Exposed vars for the camera position from the target.
@jjhesk
jjhesk / FantasticCamera.cs
Created February 10, 2016 17:42
Fantastic Camera
/// <summary>
/// UnityTutorials - A Unity Game Design Prototyping Sandbox
/// <copyright>(c) HKM hesk 2014 </copyright>
///
///
/// This software is provided 'as-is', without any express or implied
/// warranty. In no event will the authors be held liable for any damages
/// arising from the use of this software.
///
/// Permission is granted to anyone to use this software for any purpose,