Skip to content

Instantly share code, notes, and snippets.

@nagyv
nagyv / export_presets.cfg
Created August 16, 2023 17:17
Android APK logs of Godot 4 build
[preset.0]
name="Android"
platform="Android"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
@nagyv
nagyv / main.tf
Created July 31, 2022 17:15
Postgres DB module
provider "postgresql" {
host = var.server_host
port = var.server_port
database = "postgres"
username = var.username
password = var.password
sslmode = var.sslmode
connect_timeout = 15
superuser = false
}
@nagyv
nagyv / git_push.yaml
Created September 14, 2021 07:12
GitLab CI job for Git push
# Usage
# in .gitlab-ci.yml
# commit packages:
# extends: .git:push
# stage: deploy
# variables:
# COMMIT_MESSAGE: "Hydrated packages"
# script:
# cp -r file-to-commit/* "${CI_COMMIT_SHA}/file-to-commit/"
# dependencies:
@nagyv
nagyv / middleware.py
Created October 29, 2012 09:32
Django facebook connect middleware w/ facepy
import logging
import facepy as facebook
from django.conf import settings
from django.contrib.auth.signals import user_logged_in
from django.db import models
from django.contrib.auth import logout
from django.contrib.auth.models import User
class FBAuthMiddleware(object):
def __init__(self):
@nagyv
nagyv / keybase.md
Created July 2, 2019 07:36
keybase.md

Keybase proof

I hereby claim:

  • I am nagyv on github.
  • I am nagyv (https://keybase.io/nagyv) on keybase.
  • I have a public key ASBS9dc3poTC2gmEbZN-_wX0M-SmIGwWJ5huIaxZPQwljQo

To claim this, I am signing this object:

@nagyv
nagyv / index.js
Created April 19, 2019 07:26
get and create record in GameSparks Data Service
const axios = require('axios')
require('dotenv').config()
const username = process.env.LOGIN
const password = process.env.PASSWORD
const game = process.env.GAME
async function jwtAuth(username, password, game, filter) {
const response = await axios({
url: `https://auth.gamesparks.net/restv2/auth/game/${game}/jwt`,
@nagyv
nagyv / fields.py
Created May 22, 2012 10:53
Google Protobuffer field for Django
''' A model field to store and retrieve Google Protocol Buffer objects easily.
Uses the BlobField available on GAE for storage.
Usage:
myfield = ProtobufField(protoclass=MyProtocolClass)
where MyProtocolClass is a protocol descriptor class generated from a .proto file.
The field is supposed to store only the given kind of protocol messages.
@nagyv
nagyv / 0 - odoo logs to sentry
Last active December 5, 2018 06:49 — forked from avoine/gist:2912777
Script to send rsyslog message of OpenERP to Sentry
This gist provides a simple setup to add Sentry logging to OpenERP/Odoo.
As Odoo's logging setup is rather limited, I'm using syslog to collect and forward logs to Sentry.
These scripts should run without any modification on an Ubuntu based server, assuming the paths and user names for openerp match with the ones in the `supervisord.conf` file.
To have rsyslog2sentry run fine, you'll need some python pagkages installed
$ pip install raven loggerglue
@nagyv
nagyv / rebuild_libreoffice.sh
Last active October 4, 2018 03:40 — forked from lukebranch/rebuild_libreoffice.sh
Rebuild Libreoffice for ubuntu 14.04 trusty with python2 support for python-uno
#!/bin/sh
# we need some fixes from 14.10
# sudo add-apt-repository --enable-source ppa:libreoffice/libreoffice-4-3
sudo add-apt-repository --enable-source ppa:libreoffice/libreoffice-4-3 -y
# fetch this repository
sudo apt-get update -y
# update your libreoffice installation
sudo apt-get install libreoffice python3-uno -y
# get all build dependencies for libreoffice
sudo apt-get build-dep libreoffice -y
@nagyv
nagyv / 1 - readme.md
Created June 3, 2018 19:58
using Nes with Schmervice

This is a simple example to use Nes with Schmervice in hapipal-like project.

As there might be several susbcription channels, I prefer to separate them by domain, and have a single service that handles all the even passing between different parts of the code.

Example usage:

  // somewhere in a router's handler