Skip to content

Instantly share code, notes, and snippets.

View alex-kirienko's full-sized avatar

Alexander Kirienko alex-kirienko

  • Skilld
  • Russia, Krasnodar
View GitHub Profile
@alexlee-gk
alexlee-gk / configure_cuda_p70.md
Last active March 10, 2025 15:31
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

@chadrien
chadrien / README.md
Last active April 22, 2025 15:52
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@mrded
mrded / module.php
Created June 16, 2014 10:07
Drupal 7: Entity metadata wrappers
<?php
//@see: https://drupal.org/node/1021556
$wrapper = entity_metadata_wrapper('node', $node);
$wrapper->author->mail->value();
$wrapper->author->mail->set('[email protected]');
$wrapper->author->mail = '[email protected]';
// Unified way of getting $node->title, $user->name, ...
@mrded
mrded / backend.module
Created June 12, 2014 10:56
Drupal 7: Show ctools modal via JS.
<?php
drupal_add_js('misc/ajax.js');
ctools_add_js('modal');
ctools_add_css('modal');
// Add your modal style to the settings. You find the defaults in modal.js near the top:
drupal_add_js(array(
'my-modal-style' => array(
'modalSize' => array(
@smileart
smileart / README.md
Last active March 16, 2024 15:42 — forked from agnoster/README.md
My ZSH Theme — Agnoster Mod

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@zolrath
zolrath / gist:2305333
Created April 4, 2012 20:27
tmux status line from wemux example.

For a tmux status line as seen in the example image for the wemux project: wemux

The session on the left in the example screen shot uses a patched font from the vim-powerline project. Inconsolata-dz, you beautiful creature.

To duplicate the left status line add the following lines to your ~/tmux.conf

set -g status-left-length 32
set -g status-right-length 150