Skip to content

Instantly share code, notes, and snippets.

View jjhesk's full-sized avatar
💊
cybernetics

SodiDav jjhesk

💊
cybernetics
  • ZZY
View GitHub Profile
@jjhesk
jjhesk / lookup.js
Last active January 29, 2017 18:42
The lookup tool for google spreadsheet
// G. Variables
var sh = SpreadsheetApp.getActiveSheet();
var ss = SpreadsheetApp.getActiveSpreadsheet();
var lastrow = ss.getLastRow();
//
function onOpen() {
var menuEntries = [ {name: "Search GUI", functionName: "searchUI"},
];
ss.addMenu("Search Utilities",menuEntries);// custom menu
}
@jjhesk
jjhesk / animation for loading
Last active December 23, 2016 04:59
spinner shader
#define _Smooth(p,r,s) smoothstep(-s, s, p-(r))
#define PI 3.141592
#define TPI 6.2831
#define HPI 1.570796
float GetBias(float x,float bias)
{
return (x / ((((1.0/bias) - 2.0)*(1.0 - x))+1.0));
}
float GetGain(float x,float gain)
@jjhesk
jjhesk / gl.vg
Created December 23, 2016 04:55
This is the gl shader art for login screen
uniform vec3 iResolution; // viewport resolution (in pixels)
uniform float iGlobalTime; // shader playback time (in seconds)
uniform float iTimeDelta; // render time (in seconds)
uniform int iFrame; // shader playback frame
uniform float iChannelTime[4]; // channel playback time (in seconds)
uniform vec3 iChannelResolution[4]; // channel resolution (in pixels)
uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click
uniform samplerXX iChannel0..3; // input channel. XX = 2D/Cube
uniform vec4 iDate; // (year, month, day, time in seconds)
uniform float iSampleRate; // sound sample rate (i.e., 44100)
@jjhesk
jjhesk / gist:3c01426c9fc5134b4d36147712f2dc25
Created September 20, 2016 09:02
build custom ec2 aws server configurations and walkthrough 2016
#login to aws console
ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
chmod 400 elegco.pem
#login
ssh -i "elegco.pem" ec2-user@ec2-54-69-72-231.us-west-2.compute.amazonaws.com
ssh -i "elegco.pem" ec2-user@ec2-52-24-65-74.us-west-2.compute.amazonaws.com
test:
script:
# this configures django application to use attached postgres database that is run on `postgres` host
# export DATABASE_URL=postgres://postgres:@postgres:5432/python-test-app
- apt-get update -qy
- apt-get install -y python-dev python-pip
- pip install -r requirements.txt
- python manage.py test
staging:
@jjhesk
jjhesk / translationstitching.hpp
Last active October 12, 2018 11:26
Panorama – Image Stitching in OpenCV
#include <stdio.h>
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"
@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
@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 / 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