This is an attempt to get HTML snapshot of current document in browser to report current state to server, to get a screenshot on the server without running JS
For more details: https://poste.io/doc/getting-started
Simple logging utility for NodeJS v8+.
const { warn } = require('./logger');
warn('Something');
You can set log level via LOG_LEVEL
env variable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const OpCodes = { | |
LOGIN_RESULT: -1, | |
PING_RESULT: -3, | |
UDP_CONNECT_MESSAGE: -5, | |
PLAYER_READY_MESSAGE: -7, | |
PLAYER_CONNECT_MESSAGE: -101, | |
PLAYER_DISCONNECT_MESSAGE: -103, | |
} | |
export class Connection { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /var/www/${host}/public; | |
index index.html; | |
server_name _; | |
gzip on; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prerender kurulumu | |
sudo locale-gen UTF-8 | |
sudo apt-get update | |
sudo apt-get install -y curl | |
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - | |
sudo apt-get install -y nodejs build-essential libfontconfig nginx-extras | |
sudo npm install -g phantomjs | |
sudo npm install -g prerender | |
sudo npm install -g pm2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div synaps-secim></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
init: function(elevators, floors) { | |
var upWaiters = {}, | |
downWaiters = {}, | |
idleElevators = [], | |
floorCount = floors.length, | |
arrayUnique = function(a) { | |
return a.reduce(function(p, c) { | |
if (p.indexOf(c) < 0) p.push(c); | |
return p; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse, JsonResponse, HttpResponseForbidden, HttpResponseNotAllowed, HttpResponseNotFound | |
from django.forms.models import model_to_dict | |
from django.db.models import Model | |
from django.db.models.query import QuerySet | |
from functools import wraps | |
from django.utils.decorators import available_attrs | |
from django.core import serializers | |
class PermissionError(Exception): | |
pass |
This code is a sample for a question on Stackoverflow about making multisite user models with Django 1.7.
Add these lines to your settings file:
AUTH_USER_MODEL='s1.Member'
SITE_ID = 1
AUTHENTICATION_BACKENDS = ( 'MyApp.MyModule.MyModelBackend',)
NewerOlder