Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"
window.L = (function () {
var u = (function() {
return {
/*
var obj = { a: 1 }, defs = { a: 2, b:3 };
console.log(u.defaults(obj, defs));*/
defaults: function(obj, defs) {
var i; for(i in defs) { if (defs.hasOwnProperty(i)) { if (!obj.hasOwnProperty(i)) { obj[i] = defs[i] } } }
return obj;
var strMap = [
////////////////////////////////////////////////////
// http://www.argentum.freeserve.c0.uk/lex_a.htm
//
// -------------------------------------------------
// :Achim's p144 (p144) This was f0und (minus the bl0cks sh0wn bel0w) 0n a cylinder 0f width 22 by Achim Flammenkamp in July 1994.
// Dean Hickers0n reduced it t0 a finite f0rm using figure-8s the same day.
// The neater finite f0rm sh0wn here - replacing the figure-8s with bl0cks - was f0und by David Bell in August 1994.
// See fact0ry f0r a use 0f this 0scillat0r.
@swvitaliy
swvitaliy / gist:4770750
Created February 12, 2013 15:39
data:text/html, <html contenteditable>
data:text/html, <html contenteditable>
@swvitaliy
swvitaliy / rss_agregate.php
Last active December 15, 2015 22:19
Агрегатор rss'очек :-)
<?php
// Агрегатор rss'очек :-)
$script_url = '[ Вставьте сюда url к этому скрипту ]';
$result_title = '[ Вставьте сюда title выходной rss ]';
$links = array(
'http://downloads.bbc.co.uk/podcasts/worldservice/bureve/rss.xml',
'http://downloads.bbc.co.uk/podcasts/worldservice/5floor/rss.xml',
@swvitaliy
swvitaliy / index.html
Last active December 15, 2015 22:19
Text Pretty Slider
<html>
<head>
<title>Text Pretty Slider</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="textPrettySlider.js"></script>
<style type="text/css">
span { color: red; }
</style>
</head>
<body>
@swvitaliy
swvitaliy / url_get_arg.php
Created April 7, 2013 20:11
Функция. Возвращает значение гет параметра из урла или указанное в 3м параметре дефолтное значение.
<?php
/**
* Возвращает значение гет параметра из урла или указанное в 3м параметре дефолтное значение.
*
* Example: url_get_arg('http://test.ru/test/?a=6&b=533&c=100', 'c', NULL);
*/
function url_get_arg($url, $name, $default = NULL) {
$q_pos = strpos($url, '?');
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SYNOPSIS
flask_gridfs_images.py --start
flask_gridfs_images.py --add <IMAGE_URL>
DESCRIPTION
@swvitaliy
swvitaliy / graph.js
Last active December 18, 2015 21:18
;(function (ns) {
var gid = (function (i) {
return function () {
return i++;
}
})(0);
function Node(graph, val) {
this.gid = gid();
const MYSQL_ER_HASHCHK = 1000;
const MYSQL_ER_NISAMCHK = 1001;
const MYSQL_ER_NO = 1002;
const MYSQL_ER_YES = 1003;
const MYSQL_ER_CANT_CREATE_FILE = 1004;
const MYSQL_ER_CANT_CREATE_TABLE = 1005;
const MYSQL_ER_CANT_CREATE_DB = 1006;
const MYSQL_ER_DB_CREATE_EXISTS = 1007;
const MYSQL_ER_DB_DROP_EXISTS = 1008;
const MYSQL_ER_DB_DROP_DELETE = 1009;