Skip to content

Instantly share code, notes, and snippets.

View Error-331's full-sized avatar

Sergei Selihov Error-331

  • Nikolaev (Ukraine)
View GitHub Profile
@Error-331
Error-331 / JS include dynamic async
Created June 6, 2013 20:29
How to include scripts at runtime
[
'//other-domain.com/1.js',
'2.js'
].forEach(function(src) {
var script = document.createElement('script');
script.src = src;
document.head.appendChild(script);
});
@Error-331
Error-331 / Links
Created June 29, 2012 17:40
Mobile development notes
@Error-331
Error-331 / gist:2774125
Created May 23, 2012 09:11
HTML/CSS patterns
<!--Radio buttons alignment (vertical) starts here-->
<style>
div.RadioCont {overflow: auto;}
div.RadioCont input {display: block; clear: both; float: left; height: 15px;}
div.RadioCont div {float: left; margin: 1px 0 0 2px;}
</style>
@Error-331
Error-331 / gist:2576009
Created May 2, 2012 11:42
JavaScript note
Compatibility
=============
scrollWidth and scrollHeight
----------------------------
Not proper in IE 5.5, 6, 7 (http://www.quirksmode.org/dom/w3c_cssom.html), use something like this:
if (navigator.appName == 'Microsoft Internet Explorer' && (document.compatMode == undefined || document.compatMode != 'CSS1Compat'))
{
@Error-331
Error-331 / gist:2567823
Created May 1, 2012 13:13
NodeJS note
Built-in variables
------------------
__dirname - variable containing the path where the code is running;
@Error-331
Error-331 / gist:1978943
Created March 5, 2012 15:53
MongoDB note
Commands
--------
show dbs - show all the databases
use admin - select database (example: 'admin' database)
Start of work
-------------
mongod - starts the MongoDB server
@Error-331
Error-331 / gist:1815557
Created February 13, 2012 09:55
Linux note
Комманды Linux
--------------
dmesg | more - для того что-бы посмотреть все сообщения выводимые при загрузке.
fsck - аналог Scandisk в Windows.
getty - программа которая контролирует разные опции защиты и терминала.
printenv - выводит на экран все переменные окружения.
clear - команда для очистки эарана.
<html>
<head>
<title>Autocomplete</title>
<style>
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
@Error-331
Error-331 / gist:1704218
Created January 30, 2012 12:44
Privat24 API "prp" response validation scheme
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="response">
<xs:complexType>
<xs:sequence>
<xs:element name="merchant">
<xs:complexType>
<xs:sequence>
@Error-331
Error-331 / gist:1701094
Created January 29, 2012 22:34
Ext JS xtype`s
General
=======
xtype Class
------------- ------------------
box Ext.BoxComponent
button Ext.Button
colorpalette Ext.ColorPalette
component Ext.Component
container Ext.Container