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 sqlalchemy import create_engine, Column, Integer, Unicode, ForeignKey, and_, bindparam | |
from sqlalchemy.orm import sessionmaker, relationship | |
from sqlalchemy.ext.declarative import declarative_base | |
engine = create_engine('sqlite:///:memory:', echo=True) | |
Base = declarative_base() | |
Session = sessionmaker(engine) | |
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
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <sys/un.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <errno.h> | |
#include <unistd.h> | |
struct ucred { |
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
import subprocess | |
import re | |
import os | |
# | |
# Description | |
# This script is to be used when you have a RAW vmdk disk and fear that | |
# the drive identifier, i.e. PHYSICALDRIVEX might change during reboots. | |
# This script finds the correct name matching to a configured serial and | |
# will remove the old drive and remove it, create a new one and attach it. |
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
def bsearch(items, x, L=None, R=None): | |
if L is None: | |
L = 1 | |
if R is None: | |
R = len(items) | |
if L > R: | |
return None | |
mitte = (L + R) // 2 | |
assert mitte == int(mitte) | |
if x < items[mitte-1][1]: |
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 sqlalchemy import orm | |
from sqlalchemy.engine import create_engine | |
from sqlalchemy.ext.declarative.api import declarative_base | |
from sqlalchemy.orm.scoping import scoped_session | |
from sqlalchemy.orm.session import sessionmaker | |
from sqlalchemy.schema import Column | |
from sqlalchemy.types import String | |
from zope.sqlalchemy.datamanager import ZopeTransactionExtension | |
import binascii | |
import os |
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
function submit_phone_no() | |
{ | |
$.ajax({ | |
url: "...", // your server URL here | |
type: "get", | |
dataType: "jsonp", // important for cross-domain!! | |
data: {phone_number: 01233 }, // figure out where to get this data! | |
}); |