This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ dotfiles git:(master) ✗ ./process_kill.sh chromium | |
HADOOKEN, chromium! | |
[1] 25738 killed ./process_kill.sh chromium |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "HADOOKEN, $1!" | |
ps aux | grep $1 | awk '{print $2}' | xargs kill -9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "HADOOKEN, $1!" | |
ps aux | grep $1 | awk '{print $2}' | xargs kill - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ ~ ps aux | grep chromium | |
arne 24533 6.4 0.7 3087240 123124 ? Sl 21:34 0:06 /usr/lib/chromium-browser/chromium-browser --disable-new-tab-first-run --enable-user-scripts | |
arne 24540 0.6 0.0 466772 11332 ? S 21:34 0:00 /usr/lib/chromium-browser/chromium-browser --disable-new-tab-first-run --enable-user-scripts | |
arne 24541 0.0 0.0 6504 408 ? S 21:34 0:00 /usr/lib/chromium-browser/chrome-sandbox /usr/lib/chromium-browser/chromium-browser --type=zygote | |
arne 24542 0.0 0.1 486840 32688 ? S 21:34 0:00 chromium-browser --type=zygote | |
arne 24548 0.0 0.0 560572 8392 ? S 21:34 0:00 chromium-browser --type=zygote | |
arne 24580 4.7 0.6 1357008 110692 ? Sl 21:34 0:04 /usr/lib/chromium-browser/chro | |
arne 24590 0.5 0.2 1295952 37348 ? Sl 21:34 0:00 /usr/lib/chromium-browser/chro | |
arne 24597 1.2 0.2 137 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet] | |
public HttpResponseMessage ReadWidget(long id) | |
{ | |
WidgetBusiness widgetBusiness = new WidgetBusiness(); | |
Widget widget = widgetBusiness.Get(id); | |
HttpResponseMessage response = new HttpResponseMessage(); | |
response.Content = new ByteArrayContent(widget.Data); | |
response.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment"); | |
response.Content.Headers.ContentDisposition.FileName = widget.Id.ToString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet] | |
public ActionResult ReadWidget(long id) | |
{ | |
WidgetBusiness widgetBusiness = new WidgetBusiness(); | |
Widget widget = widgetBusiness.Get(id); | |
return File(widget.Data, "image/jpg"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------objdump--------------------------------------------- | |
00000000 <.text>: | |
0: b8 ec d2 79 3f mov $0x3f79d2ec,%eax | |
5: 8d ac 24 28 02 00 00 lea 0x228(%esp),%ebp | |
c: 68 4e 8c 04 08 push $0x8048c4e | |
11: c3 ret | |
-----------------------------GDB----------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
def sqrt_calc | |
sqrt_hash = integer_sqrt_hash # instantiating hash table | |
n = 30000000 # number of test cycles to benchmark | |
Benchmark.bm do |x| | |
x.report do | |
n.times do | |
rgb_val = rand(1..255); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test | |
my_array = [1,2,3,4] | |
my_array.each do |i| | |
return i | |
end | |
end | |
puts test | |
# 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python | |
def my_func(arg_1 = []): | |
arg_1.append(1) | |
print arg_1 | |
my_func() | |
my_func() | |
# $ python test.py |
NewerOlder