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
@jjhesk
jjhesk / CharacterControllerLogic.cs
Last active February 10, 2016 17:44
Character Controller Logic
/// <summary>
/// UnityTutorials homepage: https://github.com/jm991/UnityTutorials
/// 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,
/// and to alter it and redistribute it freely, subject to the following restrictions:
///
/// 1. The origin of this software must not be misrepresented; you must not
//Allows multiple SceneView cameras in the editor to be setup to follow gameobjects.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[ExecuteInEditMode]
public class SceneViewCameraFollower : MonoBehaviour
{
#if UNITY_EDITOR
import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
package com.hypetrak.editorial.pages.list_2016;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.util.Log;
import android.view.View;
import com.hypebeast.sdk.api.exception.ApiException;
import com.hypebeast.sdk.api.model.hypetrak.htpost;
import com.hypebeast.sdk.api.resources.ht.hTrak;
@jjhesk
jjhesk / RealmRecyclerViewAdapter.java
Created March 9, 2016 06:05
realm with recyclerview adapter
public abstract class RealmRecyclerViewAdapter<T extends RealmObject, VH extends RecyclerView.ViewHolder>
extends RecyclerView.Adapter<VH> { //put this in `io.realm`
protected LayoutInflater inflater;
protected RealmResults<T> realmResults;
protected Context context;
private final RealmChangeListener listener;
public RealmRecyclerViewAdapter(Context context, RealmResults<T> realmResults, boolean automaticUpdate) {
if (context == null) {
throw new IllegalArgumentException("Context cannot be null");
@jjhesk
jjhesk / Event.js
Created April 1, 2016 02:22
up vote 0 down vote accepted You can control this by specifying the format option, in your case you'd want to set it to false to disable the formatting entirely: FB_event_id: { type: Types.Number, format: false, required: true, initial: true } (I've just updated the docs to specifically mention that you can set this option to false to disable fo…
// models/Event.js
var keystone = require('keystone'),
Types = keystone.Field.Types;
var Event = new keystone.List('Event');
Event.add({
FB_event_id: { type: Types.Number, required: true, initial: true, format: false },
name: { type: Types.Text },
FB_event_name: { type: Types.Text },
@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
@jjhesk
jjhesk / anyhow.js
Created May 5, 2016 02:17
script paths
var base_url = "http://www.photo-host.org/";
var base_url_js = "http://www.photo-host.org/content/system/js/";
var uploadify_swf = "/content/system/js/uploadify.swf";
var uploader_file = "/upload.php";
var zeroclip_swf = "http://www.photo-host.org/content/system/js/ZeroClipboard.swf";
var session_id = "59b189a3d4299f4a268d0d19ec76f0f6";
var virtual_url_image = "http://www.photo-host.org/image/";
var virtual_url_uploaded = "http://www.photo-host.org/uploaded/";
var config = {
@jjhesk
jjhesk / NestingFragment.java
Last active August 1, 2016 07:48
memory management for the leak fix for on LILIPOP before.
public class NestingFragment extends Fragment {
//...other codes
private FragmentManager retainedChildFragmentManager;
private FragmentHostCallback currentHost;
private Class fragmentImplClass;
private Field mHostField;
{
//Prepare the reflections to manage hiden fileds