Skip to content

Instantly share code, notes, and snippets.

View flask_basics.py
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
print "started on 8001"
@cnra
cnra / nginx.conf
Created Jun 2, 2020
scoop php cgi nginx conf
View nginx.conf
server {
listen 80;
server_name localhost;
root c:/users/user/www;
location / {
autoindex on;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$args;
View amp-yonlendirme.conf
location ~ /amp/$ {
rewrite ^(.*/)amp/$ $1 permanent;
}
@cnra
cnra / displayFPS.cs
Last active May 2, 2020
unity display fps #unity
View displayFPS.cs
/*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 Mar 1, 2020 — forked from darktable/MiniJSON.cs
Unity3D: MiniJSON
View MiniJSON.cs
/*
* 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
View mongo-gzip-backup.sh
#!/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 Jan 5, 2020
unity logz ip stat gönderme
View statsapi-unity-logzio.cs
// 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 },
View statsapi-logzio.js
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 Oct 15, 2019
wordpress docker compose
View docker-compose.yml
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 Oct 14, 2019
basic docker compose example
View docker-compose.yml
version: '3'
services:
web:
container_name: nginx_image
image: nginx
volumes:
- .:/usr/share/nginx/html
ports:
- '3000:80'