This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # remove keys by pattern | |
| redis-cli KEYS "prefix:*" | xargs redis-cli DEL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create database and user | |
| CREATE DATABASE app; | |
| CREATE USER 'appuser'@'app1.example.com' IDENTIFIED BY 'password'; | |
| GRANT ALL PRIVILEGES ON app.* TO 'appuser'@'app1.example.com'; | |
| FLUSH PRIVILEGES; | |
| # при импорте БД на локальный ПК названия таблиц преобразовываются в нижний регистр. | |
| # my.ini добавить: | |
| [mysqld] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Cursor movement | |
| h - move left | |
| j - move down | |
| k - move up | |
| l - move right | |
| w - jump by start of words (punctuation considered words) | |
| W - jump by words (spaces separate words) | |
| e - jump to end of words (punctuation considered words) | |
| E - jump to end of words (no punctuation) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| apt-get install libgtk2.0-0:i386 libstdc++6:i386 libnss3-1d:i386 lib32nss-mdns libxml2:i386 libxslt1.1:i386 libcanberra-gtk-module:i386 gtk2-engines-murrine:i386 | |
| cd /tmp | |
| apt-get download libgnome-keyring0:i386 | |
| dpkg-deb -R libgnome-keyring0_3.8.0-2_i386.deb gnome-keyring | |
| cp gnome-keyring/usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/i386-linux-gnu/ | |
| ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/i386-linux-gnu/libgnome-keyring.so.0 | |
| ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0 | |
| ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/libgnome-keyring.so.0.2.0 | |
| wget http://airdownload.adobe.com/air/lin/download/2.6/AdobeAIRInstaller.bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('itemServices', ['ngResource']) | |
| .factory('Item', ['$resource', | |
| function ($resource) { | |
| return $resource('items/:id', | |
| {id: '@id'}, | |
| { | |
| query: { | |
| isArray: true, | |
| method: 'GET', | |
| params: {}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Node.js CheatSheet. | |
| // Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
| // Download: http://nodejs.org/download/ | |
| // More: http://nodejs.org/api/all.html | |
| // 0. Synopsis. | |
| // http://nodejs.org/api/synopsis.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
| // jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
| // author: Pawel Kozlowski | |
| var myApp = angular.module('myApp', []); | |
| //service style, probably the simplest one | |
| myApp.service('helloWorldFromService', function() { | |
| this.sayHello = function() { | |
| return "Hello, World!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function debounce(func, wait, immediate) { | |
| var timeout; | |
| return function() { | |
| var context = this, args = arguments; | |
| clearTimeout(timeout); | |
| timeout = setTimeout(function() { | |
| timeout = null; | |
| if (!immediate) func.apply(context, args); | |
| }, wait); | |
| if (immediate && !timeout) func.apply(context, args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function intersect(a, b) | |
| { | |
| var ai = bi= 0; | |
| var result = []; | |
| while( ai < a.length && bi < b.length ){ | |
| if (a[ai] < b[bi] ){ ai++; } | |
| else if (a[ai] > b[bi] ){ bi++; } | |
| else /* they're equal */ | |
| { |