Skip to content

Instantly share code, notes, and snippets.

View RushOnline's full-sized avatar

Eugene RushOnline

  • Intech
  • Great Novgorod, Russia
View GitHub Profile
@RushOnline
RushOnline / keyboard.js
Created September 2, 2015 21:37
Debug gnome shell us/ru switcher
_modifiersSwitcher: function() {
let sourceIndexes = Object.keys(this._inputSources);
let i = 0;
while (i < sourceIndexes.length) {
let source = this._inputSources[sourceIndexes[i]];
print("index: ", source.index, ", id: ", source.id);
/*
let seen = [];
let obj = this._inputSources;
pm list packages -f
@RushOnline
RushOnline / openssl-debug-compile
Last active August 29, 2015 14:21
How to configure and compile OpenSSL in DEBUG mode
./config -d shared no-asm 386 no-sse2 zlib-dynamic -g3 -ggdb -gdwarf-4 -fno-inline -O0 -DDEBUG_SAFESTACK
@RushOnline
RushOnline / DEBUG_CFLAGS
Created May 9, 2015 20:16
Good gcc debug flags
-g3 -ggdb -gdwarf-4 -O0 -fno-inline -DDEBUG -Wall -Werror
@RushOnline
RushOnline / showargs.sh
Created May 9, 2015 20:11
Show how are command line arguments (options) passed to program (function main())
#!/bin/bash
cat /proc/$$/cmdline | xargs -0 -n1 echo
@RushOnline
RushOnline / variant.cpp
Created March 18, 2015 19:37
C++ variant template
#include <memory>
#include <string>
class variant
{
public:
template <class T>
variant& operator = (T const& t)
{
@RushOnline
RushOnline / pin_macros.h
Created October 6, 2014 22:17
port bits access macros for AVR uC family (avr-gcc compiler) from scmRTOS
/*----------------------------------------------------------------------------------------------
* pin_macros.h (AVR/avr-gcc)
*----------------------------------------------------------------------------------------------
*
* Author: Oleksandr Redchuk aka ReAl ([email protected])
*
* Description: port bits access macros for AVR uC family (avr-gcc compiler)
*
* Based on macros by Ascold Volkov, Andy Mozzevilov, Aleksey Musin
*----------------------------------------------------------------------------------------------
@RushOnline
RushOnline / no-max-title.diff
Created September 26, 2014 06:14
Remove title bar on maximized windows (Gnome 3.10 Ambiance Theme)
diff --git a/metacity-1/metacity-theme-1.xml b/metacity-1/metacity-theme-1.xml
index 7aaeb54..e35b804 100644
--- a/metacity-1/metacity-theme-1.xml
+++ b/metacity-1/metacity-theme-1.xml
@@ -23,18 +23,19 @@
<border name="button_border" left="0" right="0" top="1" bottom="0"/>
</frame_geometry>
-<frame_geometry name="geometry_maximized" rounded_top_left="false" rounded_top_right="false" rounded_bottom_left="false" rounded_bottom_right="false">
+<frame_geometry name="geometry_maximized" rounded_top_left="false" rounded_top_right="false" rounded_bottom_left="false" rounded_bottom_right="false" has_title="false">
@RushOnline
RushOnline / get-installed-gnome-extensions.js
Created May 23, 2013 17:04
Take a list of installed gnome-shell extensions. Point your chromium broser to https://extensions.gnome.org/local/ , press Ctr+Shift+I to pop up developer tools, and enter following code.
$('.title-link').each(function() { console.log($(this).text()) })
@RushOnline
RushOnline / expect_binary.js
Created May 2, 2013 23:00
To get right binary response we must use overrideMimeType method of XHR in beforeSend filter method of jQuery ajax call.
$.ajax({
type: "POST",
url: href,
beforeSend: function (xhr) {
xhr.overrideMimeType("text/plain; charset=x-user-defined");
},
success: function(response) {
var binary = Array.prototype.map.call(response, function(c) { return c.charCodeAt(0) & 0xFF; });
console.debug('ajax done: ', binary);
},