Skip to content

Instantly share code, notes, and snippets.

#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using UnityEditor;
using UnityEditor.Compilation;
using UnityEngine;
/// <summary>
@cnra
cnra / amp-yonlendirme.conf
Created March 1, 2020 14:35
amp yönlendirme
location ~ /amp/$ {
rewrite ^(.*/)amp/$ $1 permanent;
}
@cnra
cnra / displayFPS.cs
Last active May 2, 2020 08:55
unity display fps #unity
/*Original Code: http://wiki.unity3d.com/index.php?title=FramesPerSecond */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DisplayFPS : MonoBehaviour {
float deltaTime = 0.0f;
@cnra
cnra / MiniJSON.cs
Last active March 1, 2020 15:14 — forked from darktable/MiniJSON.cs
Unity3D: MiniJSON
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
@cnra
cnra / mongo-gzip-backup.sh
Created January 6, 2020 08:39
mongodb b2 backup
#!/bin/bash
/bin/rm -rf /root/dumps/*
/usr/bin/mongodump --gzip --archive=/root/dumps/dumpname.tar.gz -u xxxx -p xxxxxxx
/usr/local/bin/b2 sync /root/dumps/ b2://bucket-name
@cnra
cnra / statsapi-unity-logzio.cs
Last active January 5, 2020 19:27
unity logz ip stat gönderme
// ornek istatistik fonksiyonu diger scriptlerden cagrilacak
public void SendNewScore(int score, float time)
{
// statlar dictionary olarak hazirlaniyor
var eventData = new Dictionary<string, object> {
{ "guid", Prefs.Guid},
{ "guidsub", Prefs.GuidSub},
{ "sessionid", _sessionId},
{ "nick", Prefs.ServerNick },
@cnra
cnra / statsapi-logzio.js
Created January 5, 2020 15:45
logz io stats api
const express = require('express')
var bodyParser = require("body-parser");
require('express-async-errors');
var port = process.env.PORT || 3010
const app = express()
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
@cnra
cnra / docker-compose.yml
Created October 15, 2019 18:43
wordpress docker compose
version: '3'
services:
db:
image: mysql:5.7
restart: always
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: password
@cnra
cnra / docker-compose.yml
Created October 14, 2019 01:58
basic docker compose example
version: '3'
services:
web:
container_name: nginx_image
image: nginx
volumes:
- .:/usr/share/nginx/html
ports:
- '3000:80'
@cnra
cnra / docker1.sh
Created October 13, 2019 10:59
windows docker volume trick
c1="docker run -it --rm -d -p 3000:80 -v `pwd`:/usr/share/nginx/html nginx"
echo ${c1}
docker-machine ssh default "${c1}"