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
#!/bin/sh | |
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 << "EOF" | |
# install_certifi.py | |
# | |
# sample script to install or update a set of default Root Certificates | |
# for the ssl module. Uses the certificates provided by the certifi package: | |
# https://pypi.org/project/certifi/ |
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
CREATE TRIGGER "Q_limit_answers_per_question" AFTER INSERT or UPDATE on question_answer | |
FOR EACH ROW EXECUTE PROCEDURE question_answer_insert(); | |
CREATE OR REPLACE FUNCTION question_answer_insert() | |
RETURNS TRIGGER AS | |
$body$ | |
BEGIN | |
-- Lock the existing rows to prevent race condition with other txns. | |
PERFORM * FROM question_answer WHERE question_id = NEW.question_id for UPDATE; |
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 nextDay(year, month, day): | |
"""Simple version: assume every month has 30 days""" | |
if day < 30: | |
return year, month, day + 1 | |
else: | |
if month == 12: | |
return year + 1, 1, 1 | |
else: | |
return year, month + 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
import xml.sax | |
class FartHandler(xml.sax.ContentHandler): | |
FART_LEVEL = 3 # the schema is bad and you should feel bad... | |
def __init__(self): | |
self.lvl = 0 | |
self.infarts = False | |
self.curfart = {} |
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 docutils.frontend | |
# http://docutils.sourceforge.net/docs/dev/hacking.html#parsing-the-document | |
parser = docutils.parsers.rst.Parser() | |
src = """ | |
This is a heading | |
================= |
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
# First build the python package with DEBUG, and then install the resulting python-gdb.py script into a place where gdb will find it. | |
/usr/ports/lang/python27 # make config OPTIONS_FILE_SET=DEBUG | |
/usr/ports/lang/python27 # find . -name python-gdb.py | |
./work/Python-2.7.8/python-gdb.py | |
cp ./work/Python-2.7.8/python-gdb.py \ | |
/usr/local/bin/python2.7-gdb.py | |
# Now install gdb with python support: | |
/usr/ports/devel/gdb # make config OPTIONS_FILE_SET=PYTHON |
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
#!/bin/sh | |
# Make freebsd vm | |
# fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/10.1-RELEASE/amd64/Latest/FreeBSD-10.1-RELEASE-amd64.raw.xz | |
VM="FreeBSD10" | |
RAW_IMG="$1" | |
BASE_IMG="${RAW_IMG%.raw}" | |
VMDK_IMG="${BASE_IMG}.vmdk" |
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
# get the dif based on a pull request. | |
# first get the merge info | |
% git log --format="%p" -1 refs/pull/1/merge | |
395a6b6 c07adb2 | |
# find the common parent | |
% git merge-base 395a6b6 c07adb2 | |
7a6ad5e1339681dda3ba55722307143b09685038 | |
# now get the diff for the entire thing. | |
% git diff 7a6ad5e1339681dda3ba55722307143b09685038..c07adb2 |
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
diff --git a/nanobsd/common b/nanobsd/common | |
index dc7c0a4..f7da3d4 100644 | |
--- a/nanobsd/common | |
+++ b/nanobsd/common | |
@@ -291,7 +291,11 @@ do_add_pkg () | |
mount -t nullfs -o noatime ${NANO_OBJ}/ports/packages \ | |
${NANO_WORLDDIR}/usr/ports/packages | |
- CR "cd /usr/ports/packages/All;env SIGNATURE_TYPE=none pkg add -f $1.txz && touch $1.txz.added " | |
+ local delete_it=true |
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
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk | |
index c56f7e0..120957f 100644 | |
--- a/Mk/bsd.port.mk | |
+++ b/Mk/bsd.port.mk | |
@@ -5911,17 +5911,34 @@ OPTIONS_WRONG_SINGLE+= ${single} | |
.endfor | |
.undef single | |
+# | |
+# Iterate through each OPTIONS_RADIO |
NewerOlder