Skip to content

Instantly share code, notes, and snippets.

@misha354
misha354 / 0_reuse_code.js
Created June 28, 2014 20:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
2014-07-02T21:56:13.073295+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 22275`
2014-07-02T21:56:15.053276+00:00 heroku[web.1]: State changed from starting to up
2014-07-02T21:56:16.530299+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-badlands-7905.herokuapp.com request_id=afd0dfc5-e8f9-4a60-999f-9147d6391c55 fwd="75.69.135.254" dyno=web.1 connect=1ms service=24ms status=404 bytes=269
2014-07-02T21:56:16.535743+00:00 app[web.1]: 75.69.135.254 - - [02/Jul/2014 21:56:16] "GET / HTTP/1.1" 404 18 0.0103
@misha354
misha354 / _categories_brief.html.erb
Created July 23, 2014 23:30
Problematic Javascript ERB code
<ul class="indented unstyled" id= <%="categories_brief_".concat(origin)%> >
<li class="indented unstyled"><%=link_to 'Add category', new_category_path%></li>
<!--The categories -->
<% for category in @categories %>
<li class='indented'><%= link_to category.name, Rails.application.routes.url_helpers.send( link_path, category) %> </li>
<% end %>
</ul>
String file contents
@misha354
misha354 / # weechat - 2018-07-26_13-03-42.txt
Created July 26, 2018 17:04
weechat on macOS 10.13.5 - Homebrew build logs
Homebrew build logs for weechat on macOS 10.13.5
Build date: 2018-07-26 13:03:42
vagrant@dns4-01-us1:~$ dpkg -l | grep image
ii linux-image-4.4.0-133-generic 4.4.0-133.159~14.04.1 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-133-generic-dbgsym 4.4.0-133.159~14.04.1 amd64 Linux kernel debug image for version 4.4.0 on 64 bit x86 SMP
vagrant@dns4-01-us1:~$ cat flame-kernel.sh
#!/bin/bash
/home/vagrant/systemtapbin/bin/stap -s 32 --all-modules -v -D MAXBACKTRACE=100 -D MAXSTRINGLEN=4096 -D MAXMAPENTRIES=10240 -D DMAXACTION_INTERRUPTIBLE=500 -D MAXACTION=100000 -D STP_OVERLOAD_THRESHOLD=5000000000LL flame-kernel.stp > out.stap-stacks
vagrant@dns4-01-us1:~$
@misha354
misha354 / offcpuflamegraph.svg
Created January 22, 2019 16:40
offcpuflamegraph
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
named 109035 [002] 12941659.413848: sched:sched_switch: prev_comm=named prev_pid=109035 prev_prio=120 prev_state=S ==> next_comm=swapper/2 next_pid=0 next_prio=120
7fff8181e21a __schedule ([kernel.kallsyms])
7fff8181e645 schedule ([kernel.kallsyms])
7fff81101186 futex_wait_queue_me ([kernel.kallsyms])
7fff8110204d futex_wait ([kernel.kallsyms])
7fff81103897 do_futex ([kernel.kallsyms])
7fff81104361 sys_futex ([kernel.kallsyms])
7fff81821f4e entry_SYSCALL_64_fastpath ([kernel.kallsyms])
7f48c1e35f1c __lll_lock_wait (/lib/x86_64-linux-gnu/libpthread-2.19.so)
7f48c1e39449 _L_cond_lock_1079 (/lib/x86_64-linux-gnu/libpthread-2.19.so)
This file has been truncated, but you can view the full file.
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" width="1200" height="710" onload="init(evt)" viewBox="0 0 1200 710" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Flame graph stack visualization. See https://github.com/brendangregg/FlameGraph for latest version, and http://www.brendangregg.com/flamegraphs.html for examples. -->
<!-- NOTES: -->
<defs >
<linearGradient id="background" y1="0" y2="1" x1="0" x2="0" >
<stop stop-color="#eeeeee" offset="5%" />
<stop stop-color="#eeeeb0" offset="95%" />
</linearGradient>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.