Înapoi la articole →

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 95
  1. How to keep `git log` and `git diff` output on the screen after exit

    When git uses less as pager the output of commands like git log disappears from the console screen when you exit from less.

  2. git - how to revert multiple recent commits

    Let’s assume we have a history like this: G1 - G2 - G3 - B1 - B2 - B3 Where G1-G3 are ‘good’ commits and B1-B3 are ‘bad’ commits and we want to revert them.

  3. Node.js - how to get core module source

    It is possible to ask node to show its core module source.

  4. Node.js - how to debug mocha test with node inspector

    To debug mocha test with node inspector use the delay before test: beforeEach(function(done) { //start mocha as //mocha -t 10000 --debug setTimeout(function() { done(); }, 5000); }); This way there are 5 seconds to start the node inspector and set a break…

  5. Elastic Beanstalk - cron command and RDS DB access

    Problem I have a console command in php which needs access to DB.

  6. By default Elastic Beanstalk console tool (eb) adds config files to .gitignore.

  7. JS libraries for charts (links)

    D3.js D3.js is a JavaScript library for manipulating documents based on data.

  8. How to set up git server on ubuntu with push email notifications

    Git Server Prerequisites are git and ssh-server (apt-get install openssh-server).

  9. Amazon NoSQL Solutions

    Amazon provides following NoSQL storage options: [SimpleDB] (http://aws.amazon.com/simpledb/) - Amazon SimpleDB is a highly available and flexible non-relational data store that offloads the work of database administration.

  10. Angular.js and SEO - pre-render content on the server

    With angular.js you have an HTML which looks like this: <span>{{variableValue}}</span> <ul> <li ng-repeat="item in items" ng-bind="item.name"></li> </ul> The simple way to make this content SEO-friendly is to pre-render data on the server and then allow a…

  11. PHP - utf-8 strings handling

    Enable mbstring function overloading mode and set default encoding for string functions to utf-8 in php.ini: mbstring.internal_encoding = UTF-8 mbstring.func_overload = 7 These settings allow us to use “usual” php string functions like substr() for utf-8…

  12. Want Scalable Application Architecture? Check AngularJS.

    The Scalable JavaScript Application Architecture is a presentation by Nicholas Zakas where he suggests a flexible and scalable architecture for JavaScript applications.

  13. Window managers for Google Chrome

    A list of extensions to manage position of chrome tabs / windows and to create splits.

  14. git - viewing changes - diff and log

    Diff and log between two branches (all changes on both branches) To see all changes between two branches, use diff with two or three dots and log with three dots between branch names.

  15. git - find not merged branches

    Branches that were not merged with master: git branch -a --no-merged (or git branch -a --no-merged master) Branches that were merged with feature: git branch -a --merged feature Branches that were merged not with feature: git branch -a --no-merged feature…

  16. git - Your branch is ahead of 'origin/master' by 1 commit after pull

    Your branch is ahead of ‘origin/master’ by 1 commit (or X commits) after git pull origin master.

  17. git - find all branches where file was changed

    Solution from stackoverflow.

  18. Yii and jquery.localtime.js - display dates in user local timezone

    With this method we work on the server with UTC timezone dates and convert them to a user local timezone on client.

  19. global ajax response handler and jquery.localtime plugin

    The jquery.localtime plugin allows to convert date/time strings to a local user time on a client site.

  20. innodb notes

    Below are some notes regarding the innodb transactions and locks.

  21. git - submodule helpers

    Below are some git commands which can be useful to resolve problems with submodules.

  22. Yii url rules - optional parameters

    Assume we have an action “articles/get” which accepts optional parameters and we want to setup following URLs: articles/[article id or name] articles/[article id or name]/draft articles/[article id or name]/revisions/99 articles/[article id or name]/revis…

  23. selenium - problem with big file upload

    Problem Selenium 2.25.0, python 2.7, ubuntu 12.04, Firebox 4.0 (yes, old version but we need it) hangs when uploading a file larger then (about) 600KB.

  24. express.js and ejs - reuse template on server and client

    ejs has a client-side support but documentation and examples do not describe how to reuse the same template on the server and on the client side.

  25. selenium webdriver - get webelement by jQuery selector

    This can be necessary for example for selector like #id > li:visible.

  26. selenium webdriver - trigger event on element via jQuery

    The ’executeScript’ method of the webdriver receives additional ‘arguments’ variable and we can pass WebElement instances to the script.

  27. selenium webdriver - set php session cookie

    To set the php session cookie we can use the addcookie (or python version add_cookie) method of the webdriver.

  28. git - use vim with fugitive to resolve merge conflicts

    To use fugitive as a merge tool you can run the following commands: git config --global mergetool.fugitive.cmd 'vim -f -c "Gdiff" "$MERGED"' git config --global merge.tool fugitive Links stackoverflow fugitive screencast

  29. vim - replace a word with yanked text multiple times

    It is often useful to copy, let’s say new_name, to clipboard and then replace one or more occurrences of old_name with it.

  30. Speedup unit tests by moving MySql data to memory [Ubuntu]

    There are several ways to speedup slow unit tests which interact with database: Refactor code and tests and do not interact with db in unit tests Use sqlite db in memory instead of MySql Use MySql MEMORY engine Move MySql data to memory It is better to try

  31. phpmyadmin and eaccelerator problem

    Error when trying to access phpmyadmin (in Chrome): Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

  32. PHP - friend a class via extend

    C++ allows to declare one class as a friend of another one.

  33. git - rename branch (local and remote)

    Rename local branch: git branch -m old-branch-name new-branch-name Rename remote branch: #delete remote branch with old name git push origin :old-branch-name # create remote renamed branch git push origin new-branch-name Links stackoverflow

  34. git - remove already deleted files

    To remove files that were already deleted on the file system, run git add with -u flag: git status D abc.c git add -u This tells git to automatically stage tracked files - including deleting the previously tracked files.

  35. GImport yii extension

    GImport yii extension implements recursive import of directories with caching.

  36. Angular.js POST data to PHP

    By default angular.js sends all data in json.

  37. yii - catch and log MySQL deadlock errors

    This method allows to log InnoDB monitor output when deadlock error occured.

  38. oauth 1.0 notes

    oAuth 1.0 flow A good explanation image from oauth.net: Flow description: Consumer has Consumer Key and Consumer Secret (shared secret) A) Consumer requests Request Token call get_request_token from Service Provider, send oauth_consumer_key oauth_signatur…

  39. git - colored diff, branch, etc output by default

    To have colored git commands output, use the following command: git config color.ui true or (globally) git config --global color.ui true Alternatively, you can set color for individual git commands. git config color.branch auto git config color.diff auto…

  40. selenium - run tests on a virtual display

    Selenium tests require browser to run, so usually we run them on the X-server enabled machine.

  41. selenium - problem with loading x_ignore_nofocus.so

    Problem: selenium fails to start Firefox with following error: 'The browser appears to have exited before we could connect.

  42. git - your branch and 'origin/xxx' have diverged error

    Git error: Your branch and 'origin/xxx' have diverged, and have 1 and 1 different commit(s) each, respectively.

  43. yii - class table inheritance

    It seems that we have no perfect solution for class table inheritance (or multiple table inheritance) in yii (comparing to the very good one for single table inheritance).

  44. git - checkout and track remote branch

    Note: in recent git versions, it is enough to do git pull and git checkout feature to checkout and start tracking the remote branch.

  45. jQuery - check minimal required version

    To check whether jQuery is loaded to the page and verify minimum version: if (typeof jQuery == 'undefined' || !