Skip to content

Instantly share code, notes, and snippets.

View kaero's full-sized avatar
🐢
slow developer

Philipp Kovalev kaero

🐢
slow developer
View GitHub Profile
<link href="https://eventclub.pro/calc/main.css" rel="stylesheet">
<iframe id="waterevents-calc-frame" src="https://eventclub.pro/calc/" width="100%"></iframe>
<script>
window.addEventListener('load', function() {
var f = document.getElementById('waterevents-calc-frame');
var h = f.contentWindow.document.body.scrollHeight;
f.height = h + 'px';
});
</script>
" dont backup anything if vim launched with root priveleges
if $USER != 'root'
" create and set backup, swap and undo directories
let s:tmp_path = '/tmp/vim_temp/' . $USER . '/'
if ! filewritable(s:tmp_path)
silent execute '!mkdir -p "' . s:tmp_path . '"'
else
" remove backups older than 8 days (-ctime +8)
silent execute '!find "' . s:tmp_path . '" -type f -ctime +8 -delete'
endif

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel/kptr_restrict=0

perf record -i -g -e cycles:u -- ~/sources/node/node --perf-basic-prof script.js

perf script | egrep -v "( __libc_start| LazyCompile | v8::internal::| Builtin:| Stub:| LoadIC:|\[unknown\]| LoadPolymorphicIC:)" | sed 's/ LazyCompile:[*~]\?/ /' | ~/sources/FlameGraph/stackcollapse-perf.pl > out.perf-folded
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
$ make openmw-wizard
Scanning dependencies of target components
[ 0%] Building CXX object components/CMakeFiles/components.dir/process/processinvoker.cpp.o
openmw_pvdk/components/process/processinvoker.cpp:65:14: error: use of undeclared identifier 'QCoreApplication'; did you mean 'QApplication'?
QDir dir(QCoreApplication::applicationDirPath());
^~~~~~~~~~~~~~~~
QApplication
/Library/Frameworks/QtGui.framework/Headers/qwindowdefs.h:87:7: note: 'QApplication' declared here
class QApplication;
^

Keybase proof

I hereby claim:

  • I am kaero on github.
  • I am twilightfeel (https://keybase.io/twilightfeel) on keybase.
  • I have a public key whose fingerprint is 94CF C072 3186 73FC 7A36 FE34 AC23 E3FC 53FD 3288

To claim this, I am signing this object:

var fs = require('fs'),
util = require('util'),
xamel = require('./'),
Tag = require('./lib/xml').Tag;
/**
* @param {NodeSet} nset
* @returns {Object} plain object
*/
function serializeNodeSet(nset) {
var net = require('net'),
Memcached = require('memcached'),
mock = net.createServer(function(sock) {
setTimeout(function() {
sock.destroy();
}, 30000);
}),
memcached = new Memcached(['127.0.0.1:11219'], {
namespace elmo {
using namespace node;
using namespace v8;
static Handle<Value> get_loop_state(const Arguments& args) {
HandleScope scope;
Local<Array> handles = Array::New();