Skip to content

Instantly share code, notes, and snippets.

View jiakuan's full-sized avatar

Jake W jiakuan

View GitHub Profile
@jiakuan
jiakuan / README.md
Created January 19, 2023 11:56 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@jiakuan
jiakuan / Elemental2CanvasCircleExample.java
Created January 7, 2023 23:45 — forked from branflake2267/Elemental2CanvasCircleExample.java
GWT Elemental 2 Canvas and 2d Context use. (casting from NativeObject).
import elemental2.CanvasRenderingContext2D;
import elemental2.Document;
import elemental2.Global;
import elemental2.HTMLBodyElement;
import elemental2.HTMLCanvasElement;
/**
* <inherits name="elemental2"/>
*/
public class Elemental2CanvasCircleExample implements EntryPoint {
@jiakuan
jiakuan / drupal-views-share-global-text-field
Created February 15, 2021 06:09 — forked from chrisjlee/drupal-views-share-global-text-field
share url's for facebook, twitter, pinterest with just get variables
<ul>
<li class="share-text">Share this>/li>
<li class="share-tw"><a href="http://twitter.com/share?text=[title]"><span></span></a></li>
<li class="share-fb"><a href="http://www.facebook.com/sharer.php?u=/node/[nid]&p=[title]"><span></span></a></li>
<li class="share-pinterest"><a href="http://pinterest.com/pin/create/button/?url=/node/[nid]&description=[title]"><span></span></a></li>
</ul>
@jiakuan
jiakuan / share-urls.md
Created February 15, 2021 06:09 — forked from apisandipas/share-urls.md
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@jiakuan
jiakuan / MWWebSnapshot.m
Created April 19, 2020 04:17 — forked from mralexgray/MWWebSnapshot.m
Create Snapshot Images from Webpages in Cocoa
// MWWebSnapshot
//
// Created by Jim McGowan on 08/09/2010.
// Copyright 2010 Jim McGowan. All rights reserved.
//
// This code is made available under the BSD license.
// Please see the accompanying license.txt file
// or view the license online at http://www.malkinware.com/developer/License.txt
//
@jiakuan
jiakuan / terminal-git-branch-name.md
Created October 16, 2019 06:56 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Mac)

Add Git Branch Name to Terminal Prompt (Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@jiakuan
jiakuan / README.md
Created August 19, 2019 08:01 — forked from magnetikonline/README.md
Install Parallels version 10/11/12/13 tools on Ubuntu server guest.

Install OSX Parallels version 10/11/12/13 tools on Ubuntu server guest

Have tested these instructions successfully under Ubuntu 16.04LTS and 14.04LTS.

  • Create Ubuntu server instance under Parallels (obviously).
  • Start VM, goto Actions - Install Parallels Tools... to mount the ISO image.
    • Note: if this fails, or updating tools for an existing guest you can do the following:
    • Goto Devices > CD/DVD 1 > Connect Image....
    • Select the following ISO image: /Applications/Parallels Desktop/Contents/Resources/Tools/prl-tools-lin.iso.
    • This will mount the tools CD image.
  • From the terminal, run the following commands:
@jiakuan
jiakuan / effective_modern_cmake.md
Created July 25, 2019 01:07 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@jiakuan
jiakuan / buildPicker.js
Created March 2, 2019 07:09 — forked from robtarr/buildPicker.js
Canvas Color Picker
var app = {};
app.$colors = $('canvas.color-palette');
app.colorctx = app.$colors[0].getContext('2d');
// Build Color palette
app.buildColorPalette = function() {
var gradient = app.colorctx.createLinearGradient(0, 0, app.$colors.width(), 0);
// Create color gradient
@jiakuan
jiakuan / letsencrypt-GAE.md
Created July 4, 2017 04:28
Set up HTTPS for Google App Engine using Let's Encrypt

Copied from https://www.jeffgodwyll.com/posts/2016/letsencrypt

Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. Let’s Encrypt is a service provided by the Internet Security Research Group (ISRG)

About Let's Encrypt

This post won't go into details as to what Let's Encrypt is about. We should probably read the FAQs if we want to learn more.

Until the Google App Engine Team fully automate the process of using Let's Encrypt on Google App Engine or even provide some sort of API to handle certs, we'll probably have to find ways of either automating the process just a little bit or stick to some other easier cert authority.