Skip to content

Instantly share code, notes, and snippets.

@shial4
shial4 / Log.swift
Last active August 27, 2018 02:38
Swift Logger
import Foundation
public class Log {
private enum LogType: Int, CustomStringConvertible {
public var description: String {
switch self {
case .verbose:
return "[VERBOSE]"
case .info:
return "[INFO]"
@hnq90
hnq90 / CheckEmoji.php
Created November 26, 2014 10:18
Check Emoji exist in string
/**
* Check emoji from string
*
* @return bool if existed emoji in string
*/
function checkEmoji($str)
{
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';
preg_match($regexEmoticons, $str, $matches_emo);
if (!empty($matches_emo[0])) {
@reiki4040
reiki4040 / signal.go
Created October 2, 2014 14:38
signal handling example for golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {