Skip to content

Instantly share code, notes, and snippets.

Artem ArtemGr

  • Bizlink
Block or report user

Report or block ArtemGr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ArtemGr
ArtemGr / SCGI.java
Last active Nov 27, 2018
Java SCGI connector
View SCGI.java
/*
Copyright (c) 2008 ArtemGr
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@ArtemGr
ArtemGr / gist:45741
Created Jan 11, 2009
Moving to FreeBSD 7.1 using Pover Recovery at server4you.de
We couldn’t find that file to show.
@ArtemGr
ArtemGr / gist:51009
Created Jan 23, 2009
Enable optional transparency in PlotKit
View gist:51009
[artemgr@pcbsd /tmp/plotkit-patches]$ git diff
diff --git a/PlotKit/SweetCanvas.js b/PlotKit/SweetCanvas.js
index dcfdfc5..39cbf2c 100644
--- a/PlotKit/SweetCanvas.js
+++ b/PlotKit/SweetCanvas.js
@@ -195,6 +195,10 @@ PlotKit.SweetCanvasRenderer.prototype._renderLineChart = function() {
// faux shadow for firefox
if (this.options.shouldFill) {
+ // Transparent fill.
@ArtemGr
ArtemGr / openid_store.py
Created Mar 5, 2009
memcache openid store
View openid_store.py
"""Store implementation for the openidenabled.com python library, using the GAE's memcache."""
from openid.store.interface import OpenIDStore
from openid.store import nonce
import string, logging
import google.appengine.api.memcache
memcache = google.appengine.api.memcache.Client()
class MemcacheStore(OpenIDStore):
"""Implements http://openidenabled.com/files/python-openid/docs/2.2.1/openid.store.interface.OpenIDStore-class.html"""
@ArtemGr
ArtemGr / comment.touchpad.in.xorg.conf.hs
Created Mar 11, 2009
Automatically comment out the touchpad in the xorg.conf if there is an external mouse attached.
View comment.touchpad.in.xorg.conf.hs
#!/usr/local/bin/runhaskell
-- Compile with: ghc --make -O2 -optl-s -odir /tmp -hidir /tmp mouse.hs
import Data.List
import Debug.Trace
import Control.Monad
import System.Directory; import System.Environment; import System.IO
{- If there is a USB mouse present in the system, then comment out the touchpad
mouse in "xorg.conf", otherwise uncomment it.
Note: moused should be disabled (in rc.conf and devd.conf) to free the
@ArtemGr
ArtemGr / NotEmptyQuery.scala
Created Mar 12, 2009
Lucene matching non-empty fields.
View NotEmptyQuery.scala
import org.apache.lucene.search._, org.apache.lucene.document._, org.apache.lucene.index._
class NotEmptyQuery (emptyTerm: Term) extends MultiTermQuery {
override def toString (field: String) = "NotEmptyQuery(" + (if ((field ne null) && field.length != 0) field else emptyTerm.field) + ")"
override def getEnum (reader: IndexReader) = new FilteredTermEnum {
setEnum (reader.terms (emptyTerm)) // Position at the start of the field terms.
var theEnd = false
override def termCompare (term: Term): Boolean =
if (term.field == emptyTerm.field && term.text != emptyTerm.text) true else {theEnd = true; false}
override def difference (): Float = 1
@ArtemGr
ArtemGr / Program.fs
Created Mar 24, 2009
Simple ".NET compact framework" application for Windows Mobile
View Program.fs
#light
open System
open System.Drawing
open System.Windows.Forms
let main =
let form = new Form (Text = "Current time", Visible = true)
let addButton text x y fnc =
let but = new Button (Text = text) in but.Location <- new Point (x, y); but.Click.Add (fnc); form.Controls.Add (but); but
let ofs = 2
View clean.javap
Compiled from "main.scala"
public class fastcms.scalaAPI.Persistent extends java.lang.Object implements scala.ScalaObject{
private java.lang.String value;
private java.lang.String name;
public fastcms.scalaAPI.Persistent();
Code:
0: aload_0
1: aconst_null
View NUCENHANCER-34.patch
Index: src/java/org/datanucleus/enhancer/asm/JdoMethodAdapter.java
===================================================================
--- src/java/org/datanucleus/enhancer/asm/JdoMethodAdapter.java (revision 5997)
+++ src/java/org/datanucleus/enhancer/asm/JdoMethodAdapter.java (working copy)
@@ -80,20 +80,28 @@
if (enhancer.isPersistenceCapable(ownerName))
{
AbstractClassMetaData cmd = null;
+ boolean fieldInThisClass;
if (enhancer.getClassMetaData().getFullClassName().equals(ownerName))
@ArtemGr
ArtemGr / Derby stack trace.
Created Apr 14, 2009
Derby getIndexInfo SQLException
View Derby stack trace.
java.sql.SQLException: Column 'PARAM1' already exists.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
You can’t perform that action at this time.