This file contains 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
Emerge Kernel sources | |
$ sudo -s | |
# emerge -uva sys-kernel/gentoo-sources | |
# cd /usr/src/linux | |
Copy recent kernel config to start with it | |
# zcat /proc/config.gz > .config | |
# make menuconfig |
This file contains 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
REM ***** BASIC ***** | |
' | |
' Get-a-Clue : OTR Global Grid parser | |
' (c) 2008 Paul Philippov, themactep.com | |
' version 2008-10-20 13:59 | |
' | |
Option Explicit | |
Sub ExportQuotesToNewDocument | |
Dim OpenProperties(1) as New com.sun.star.beans.PropertyValue |
This file contains 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
// Is this a JavaScript bug? | |
// Running the code below alert's "three". | |
var calls = ["one", "two", "three"] | |
for(var i in calls) { | |
var name = calls[i]; | |
this[name] = function(){ | |
alert(name); | |
} | |
} |
This file contains 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
script/generate scaffold RedRose vs script/generate scaffold red_rose | |
<%= controller_name %> # RedRoses red_roses !! | |
<%= controller_class_path %> # | |
<%= controller_file_path %> # red_roses red_roses | |
<%= controller_class_nesting %> # | |
<%= controller_class_nesting_depth %> # 0 0 | |
<%= controller_class_name %> # RedRoses RedRoses | |
<%= controller_underscore_name %> # red_roses red_roses | |
<%= controller_singular_name %> # RedRose red_rose !! |
This file contains 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
# | |
# a request to http://lastfm-api-ext.appspot.com/2.0/ | |
# with outtype=js sometimes gives me an error like this: | |
# | |
Traceback (most recent call last): | |
File "/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 507, in __call__ | |
handler.get(*groups) | |
File "/base/data/home/apps/lastfm-api-ext/1.178/main.py", line 60, in get | |
result = packages[package](params)[method]() |
This file contains 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
<?php | |
// php equivalent of ruby one-liner | |
// "строка текста!".chars.to_a.last | |
function u_str_split($string, $split_length=1) | |
{ | |
preg_match_all('`.`u', $string, $arr); | |
$arr = array_chunk($arr[0], $split_length); | |
$arr = array_map('implode', $arr); | |
return $arr; |
This file contains 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
<pre> | |
<%= "<em>text</em>".class %> | |
<%= raw("<em>text</em>").class %> | |
<%= "<em>text</em>" %> | |
<%= raw("<em>text</em>") %> | |
<%= ["<em>text</em>"].join %> | |
<%= [raw("<em>text</em>")].join %> |
This file contains 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
#!/usr/bin/env ruby | |
# | |
# Outward spiral matrix builder | |
# 2012, Paul Philippov <[email protected]> | |
# | |
def show_usage | |
puts 'Usage: $0 <number>' | |
exit | |
end |
This file contains 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/sh | |
# | |
# Binary file padder. | |
# Pads binary file with 0xFF to match full size of flashing chip. | |
# | |
# Example: | |
# ./binpadder.sh openipc-u-boot-t10-universal.bin 8 | |
# | |
# Running this command will produce a new binary file | |
# openipc-u-boot-t10-universal-8MB-padded.bin |
OlderNewer