Skip to content

Instantly share code, notes, and snippets.

@indeyets
indeyets / calendar.html
Created Nov 17, 2012
Календарь зоны действия
View calendar.html
<iframe src="https://www.google.com/calendar/embed?showCalendars=0&amp;showTz=0&amp;mode=AGENDA&amp;height=500&amp;wkst=2&amp;hl=ru&amp;bgcolor=%23FFFFFF&amp;src=9ir9pkisi285laj0buv9r3caug%40group.calendar.google.com&amp;color=%23B1440E&amp;ctz=Europe%2FMoscow" style=" border-width:0 " width="650" height="500" frameborder="0" scrolling="no"></iframe>
@indeyets
indeyets / rdf-types.yaml
Created Mar 14, 2012
RDF Types hierarchy (based on XQuery, XPath specifications)
View rdf-types.yaml
data_types: # child-values can be used "as-is" if parent-type is requested
"xs:anyType":
"xs:untyped": {}
"xs:anySimpleType":
"xs:anyAtomicType":
"xs:untypedAtomic": {}
"xs:dateTime": {}
"xs:date": {}
"xs:time": {}
"xs:duration":
View pake_antpattern.php
<?php
/**
* Mimics ant pattern matching.
* New addition (afaict): any pattern ending in '/' will only match directories
* @see http://ant.apache.org/manual/dirtasks.html#patterns
* @todo more complete testing
*/
function pake_antpattern($files, $rootdir)
{
$results = array();
@indeyets
indeyets / php-github.php
Created Mar 24, 2011
GitHub OAuth + API test
View php-github.php
<?php
class GitHubAuth
{
const AUTH_URL = 'https://github.com/login/oauth/authorize';
const ACCESS_TOKEN_URL = 'https://github.com/login/oauth/access_token';
private $app_id;
private $app_secret;
View RdfMapper.py
from gi.repository import Midgard
class RdfMapper:
def __init__(self, mgd):
self.mgd = mgd
self.read_types()
def read_types(self):
for gtype in Midgard.Object.__gtype__.children:
self.read_type(gtype)
View RdfMapper.py
from gi.repository import Midgard
class RdfMapper:
def __init__(self):
self.read_types()
def read_types(self):
for gtype in Midgard.Object.__gtype__.children:
self.read_type(gtype)
View introspect.py
import inspect
import gi
from gi.repository import Midgard
Midgard.init()
for name, obj in inspect.getmembers(Midgard):
if inspect.isclass(obj):
print(obj.__name__)
View gettext-stpncpy.patch
diff -Naurp gettext-0.18.1.1.orig/gettext-tools/configure gettext-0.18.1.1/gettext-tools/configure
--- 1/gettext-tools/configure 2010-06-06 13:12:20.000000000 -0700
+++ 2/gettext-tools/configure 2010-08-13 23:24:09.000000000 -0700
@@ -40606,7 +40606,9 @@ else
#include <stdlib.h>
#include <string.h> /* for strcpy */
/* The stpncpy prototype is missing in <string.h> on AIX 4. */
+#ifndef stpncpy
extern char *stpncpy (char *dest, const char *src, size_t n);
+#endif
View question.py
tmp = [{'a': 'b'}, {'c': 'd'}]
for x in tmp:
for k in x.keys():
print("key: %s, value: %s" % (k, x[k]))
@indeyets
indeyets / gist:740344
Created Dec 14, 2010
mongrel2-appserver.conf
View gist:740344
mongrel2 = Host(name="localhost", routes={
'/': Handler(
send_spec='tcp://127.0.0.1:9997',
send_ident='53f9f1d1-1116-4751-b6ff-4fbe3e43d142',
recv_spec='tcp://127.0.0.1:9996', recv_ident='')
})
main = Server(
uuid="82209006-86FF-4982-B5EA-D1E29E55D481",
access_log="/logs/access.log",