Skip to content

Instantly share code, notes, and snippets.

@Royalone94
Royalone94 / toUnicode.js
Created July 11, 2019 13:01 — forked from littlee/toUnicode.js
JavaScript convert string to unicode format
function toUnicode(str) {
return str.split('').map(function (value, index, array) {
var temp = value.charCodeAt(0).toString(16).toUpperCase();
if (temp.length > 2) {
return '\\u' + temp;
}
return value;
}).join('');
}
@Royalone94
Royalone94 / toUnicode.js
Created July 11, 2019 13:01 — forked from littlee/toUnicode.js
JavaScript convert string to unicode format
function toUnicode(str) {
return str.split('').map(function (value, index, array) {
var temp = value.charCodeAt(0).toString(16).toUpperCase();
if (temp.length > 2) {
return '\\u' + temp;
}
return value;
}).join('');
}
@Royalone94
Royalone94 / temp.php
Created May 29, 2019 08:47 — forked from ugraphix/temp.php
Temperature conversions (Fahrenheit, Celsius, Kelvin) using PHP
<?php
//temp.php
//Celsius to Fahrenheit ° F = 9/5 ( ° C) + 32
//Fahrenheit to Celsius ° C = 5/9 (° F - 32)
//Celsius to Kelvin K = ° C + 273.15
//Kelvin to Celsius ° C = K - 273.15
//Fahrenheit to Kelvin K = 5/9 (° F - 32) + 273.15
//Kelvin to Fahrenheit ° F = 9/5 (K - 273.15) + 32
@Royalone94
Royalone94 / mysql2-mojave.md
Created March 21, 2019 19:16 — forked from fernandoaleman/mysql2-mojave.md
Install mysql2 on MacOS Mojave

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@Royalone94
Royalone94 / MySQL_5-7_macOS.md
Created March 21, 2019 19:16 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@Royalone94
Royalone94 / ClearCanvas.java
Created December 14, 2018 03:38 — forked from comoc/ClearCanvas.java
Clear the Canvas of a SurfaceView for Android.
// Obtain a SurfaceView.
// SurfaceView surfaceView = (SurfaceView)findViewById(R.id.surfaceView1);
Canvas canvas = surfaceView.getHolder().lockCanvas();
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
// Draw someting
surfaceView.getHolder().unlockCanvasAndPost(canvas);
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema artistlancer
-- -----------------------------------------------------