Skip to content

Instantly share code, notes, and snippets.

@Eccenux
Eccenux / odbc_sql_test.php
Created July 23, 2014 11:09
PHP Bug #47803 test case
<?
include './odbc_sql_test_settings.php';
echo phpversion();
date_default_timezone_set('Europe/Warsaw');
$link = odbc_connect(DB_SETTINGS_DSN, DB_SETTINGS_USER, DB_SETTINGS_PASS);
$upd_params = array(
@Eccenux
Eccenux / index.mini.html
Created August 5, 2014 11:07
PHP DOM parser - problem with HTML whitespace
<!DOCTYPE html>
<!--
Copyright: ©2014 Nux
License: CC0
-->
<html>
<head>
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta charset="UTF-8">
@Eccenux
Eccenux / archive.py
Last active October 8, 2015 06:54
Python archive (zip) helper class
#!/usr/bin/env python
import os
import zipfile
"""
Helper class that lets one add whole directory contents.
License
--------------------
@Eccenux
Eccenux / overlayText.js
Created December 16, 2014 15:05
Google Maps `overlayText` helper
//
// Overlay for adding some HTML text on cords specified by bounds over the given map
//
function overlayText(bounds, HTMLcontent, map, minZoomToBeShow)
{
// Now initialize all properties.
this.bounds_ = bounds;
this.HTMLcontent_ = HTMLcontent;
this.map_ = map;
@Eccenux
Eccenux / gist:f338e1d25530d9e05a40
Last active August 29, 2015 14:14
Geocoding example
// see: https://developers.google.com/maps/documentation/javascript/geocoding
var geocoder = new google.maps.Geocoder();
geocoder.geocode({
address: someAddressString,
region: 'no'
},
function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var location = results[0].geometry.location;
latitude.value = location.lat();
@Eccenux
Eccenux / DefaultFilters.js
Last active December 9, 2015 11:17
Ext.ux.grid.DefaultFilters
/**
* Helps applying default filter values from grid to store.
*
* @example In your window with grid you could do:
* <pre>
initComponent: function() {
this.callParent();
// apply default filters from grid to store
var grid = this.down('grid');
@Eccenux
Eccenux / FramePostman.js
Last active October 13, 2015 21:39
Simple Frame Postman
/**
Simple Frame Postman
version 1.1.2
Author: Maciej "Nux" Jaros
License: CC-BY or MIT (at ones choosing)
Usage (simple setup):
@Eccenux
Eccenux / CB.smartOpenWebPanel.code.js
Last active November 24, 2015 04:31
Custom Buttons (FF) - smartOpenWebPanel (replacement for openWebPanel)
this.smartOpenWebPanel("Translate", "https://translate.google.pl/");
@Eccenux
Eccenux / CB.openInBrowser.code.js
Created November 24, 2015 04:31
Custom Buttons (FF) - open URL from current tab in any browser
// IE
this.openCurrentUrl("c:\\Program Files\\Internet Explorer\\iexplore.exe");
// Firefox Developer Edition
this.openCurrentUrl("C:\\Program Files\\Mozilla\\Firefox Developer Edition\\firefox.exe");
// Chrome
this.openCurrentUrl("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");
// Edge
// for whatever reason this doesn't work for local files (i.e. "file:///...")
this.openCurrentUrl("c:\\windows\\system32\\cmd.exe", ["/c", "start", "microsoft-edge:%u"]);
@Eccenux
Eccenux / CascadeWindows.js
Last active February 2, 2016 19:32
Cascade window position plugin.
/* global Ext */
/**
* Cascade window position plugin.
*
* To use this plugin just add to your window
* 1. `'Ext.ux.CascadeWindows'` in `requires` property
* 2. `ptype: 'cascadewindows'` in `plugins` property
*
* @author Maciej "Nux" Jaros