Skip to content

Instantly share code, notes, and snippets.

View bentech's full-sized avatar
🇬🇧

Ben Swanson bentech

🇬🇧
  • Rako Controls Ltd
  • UK
  • 05:15 (UTC)
View GitHub Profile
from frappeclient import FrappeClient
import psycopg2
import psycopg2.extras
import unicodedata
import traceback
import datetime
print "logging in..."
client = FrappeClient("https://XXXXXXXXXXXXXXXXXX", "XXXXXXXXXXX", "XXXXXXXXXXXXXXXXX")
conn = psycopg2.connect(dbname="odoo_dbname", user="odoo_dbuser", host="odoo_dbhost", port="odoo_dbport", password="odoo_dbpwd")
@jahe
jahe / jpa-cheatsheet.java
Last active May 2, 2025 03:08
JPA Cheatsheet
/*
JPA (Java Persistence API)
Transaction Management with an Entity-Mananger:
---
entityManager.getTransaction().begin();
entityManager.persist(<some-entity>);
entityManager.getTransaction().commit();
entityManager.clear();
***NOTICE OF ACCOUNT CLOSURE***
Greetings,
Account: [email protected]
Account Action: Account Closure - Overwatch Account
Offense: Unauthorized Cheat Programs ("Hacks")
Recent activity on this account shows the use of an unauthorized cheat program, also known as a "hack.", which harms the intended player experience.
@chrishulbert
chrishulbert / bcastpacket.m
Created April 6, 2011 01:23
Send a broadcast udp message using c / obj-c
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
#include <arpa/inet.h>
- (void)sendBroadcastPacket {
// Open a socket
int sd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (sd<=0) {
NSLog(@"Error: Could not open socket");