GUIStyle mystyle = new GUIStyle("some string from the list below");
- "CN Box"
- "Button"
# Suppose we already have LXD, and already add the default image repo as images: | |
# 1. Start a new Trusty LXC container | |
host:~$ lxc launch images:ubuntu/trusty/amd64 cuda-trusty | |
# 2. Download and install CUDA on *both* host & LXC container, from https://developer.nvidia.com/cuda-downloads | |
# Note that host and container have to have *exactly* the same driver version | |
# 3. Add necessary Nvidia devices to LXC container | |
host:~$ lxc config device add cuda-trusty nvidia0 unix-char path=/dev/nvidia0 | |
host:~$ lxc config device add cuda-trusty nvidiactl unix-char path=/dev/nvidiactl |
(defn keyword->pg-enum | |
"Convert a keyword value into an enum-compatible object." | |
[enum-type kw] | |
(doto (org.postgresql.util.PGobject.) | |
(.setType enum-type) | |
(.setValue (name kw)))) | |
(def ->status | |
"Convert a keyword status into a something_status enum object" | |
(partial keyword->pg-enum "something_status")) |
; Depends on [com.notnoop.apns/apns "0.1.6"]. | |
(:import ('com.notnoop.apns APNS)) | |
(defn send-push-notification [device-token message] | |
(let [service (.build (.withSandboxDestination | |
(.withCert (APNS/newService) "resources/apns-dev-cert.p12" "password"))) | |
payload (.build (.alertBody (APNS/newPayload) message))] | |
(.push service device-token payload))) |
#!/usr/bin/env sh | |
set -euv | |
# Updated on April 2019 to reflect changes in GN | |
# See: | |
# https://github.com/ninja-build/ninja | |
# https://gn.googlesource.com/gn/ | |
# We need a recent git |
using System; | |
using System.Net; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
public class WebClientEx : WebClient | |
{ | |
public WebClientEx(CookieContainer container) |
#lang racket/base | |
; One way to define a logger | |
(define lg (make-logger 'my-logger)) | |
; Define a receiver for this logger, along with a log level | |
(define rc (make-log-receiver lg 'error)) ; also try with 'debug | |
; Another way to define a logger, with additional forms | |
(define-logger lg2) | |
(define rc2 (make-log-receiver lg2-logger 'debug)) |
/* Credit */ | |
// Inspired by grimmdev's code - https://gist.github.com/grimmdev/979877fcdc943267e44c | |
/* Dependency */ | |
// Import SimpleJSON Scripts : http://wiki.unity3d.com/index.php/SimpleJSON | |
// You can use your own JSON Parser if you want. | |
/* Limitations */ | |
// translate.googleapis.com is free, but it only allows about 100 requests per one hour. | |
// After that, you will receive 429 error response. |
// c# companion script | |
// SpriteUVToShader.cs -------------------------------------------------------------------------------------------------------------------------------- // | |
// Save you your project, add to your SpriteRenderer gameObject | |
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
[ExecuteInEditMode] |
Shader "Sprites/GlowLevels" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {} | |
_AlphaIntensity_Fade_1("_AlphaIntensity_Fade_1", Range(0, 3)) = 1 | |
_TintRGBA_Color_1("_TintRGBA_Color_1", COLOR) = (1,1,1,1) | |
_AlphaIntensity_Fade_2("_AlphaIntensity_Fade_2", Range(0, 3)) = 1 | |
_TintRGBA_Color_2("_TintRGBA_Color_2", COLOR) = (1,1,1,1) |