Skip to content

Instantly share code, notes, and snippets.

(function () {
d3.analog= function() {
var height = 100, gap=10,
xValue = function(d) { return d[0]; },
xScale = null,
color = d3.scale.category10();
function chart(selection) {
selection.each(function(d) {
var g = d3.select(this);
@sxtxixtxcxh
sxtxixtxcxh / .multitailrc
Last active June 20, 2017 06:21
.multitailrc for a DF colorscheme. usage: `multitail -CS df gamelog.txt`
colorscheme:df
# Unit types:
cs_re:magenta,black:Recruit|Lasher|Troll|Goblin|a girl
cs_re:red,black:Swordsman|Swordsdwarf|Swordmaster|skulking filth
cs_re:blue,black:liaison|Human|Elf|Dwarf|war Dog
cs_re:green,black:Marksdwarf|Bowman|Merchant|Speardwarf|Spearman|Pikeman|Pikemaster
cs_re:cyan,black:Mace Lord|Maceman|Macedwarf|Axeman|Axedwarf|Hammerdwarf|a boy
# Damage
@sxtxixtxcxh
sxtxixtxcxh / gist:2950363
Created June 18, 2012 19:54
vimrc.local
function! InsertStatuslineColor(mode)
if a:mode == 'i'
hi statusline guibg=#fbefeb guifg=#bf542f
elseif a:mode == 'r'
hi statusline guibg=#faf6e8 guifg=#dab826
else
hi statusline guibg=#e3f4ff guifg=#417598
endif
endfunction
= triangle( $direction, $bg-color, $border-color, $border-width, $top, $left, $width: 10px, $arrow-from: 'top' )
position: relative
// creates "border" or outer triangle
&:before
@if $border-width > 0
content: "\00a0"
display: block
// reduce the damage in FF3.0
position: absolute
width: 0
@sxtxixtxcxh
sxtxixtxcxh / region1-world_gen_param.txt
Created April 11, 2012 17:40
Gatalnitom World Gen
Created in DF v0.34.07.
[WORLD_GEN]
[TITLE:CREATE WORLD NOW = 4333333]
[SEED:I4V8qbF9xkkj9FjUlXUl]
[HISTORY_SEED:wm6yD6qXgpzO5F8mGyjy]
[NAME_SEED:22VXjVelU3NsP9pdJP5S]
[CREATURE_SEED:YV6TWYDZ9L9SoXaUQzcY]
[DIM:129:129]
[EMBARK_POINTS:1274]
@sxtxixtxcxh
sxtxixtxcxh / gist:1631139
Created January 18, 2012 05:19
De-Anti-SOPA Wikipedia Bookmarklet
javascript:(function(){$('#mw-sopaOverlay').remove();$('#mw-page-base, #mw-head-base, #content, #mw-head, #mw-panel, #footer').css({display: 'block'});})()
ssh_user = "user@domain.com" # for rsync deployment
remote_root = "~/domain.com/path.to/project" # for rsync deployment
def fs_deploy(relative)
puts ">>> Change Detected to: #{relative} >> Deploying"
system("rake deploy")
end
desc "Watch the site and regenerate when it changes"
task :watch do
/*
Handy url redirection that's as flexilbe as the href attribute of A tags.
There might have been an easier way to do this, if so, let me know how stupid
I am :)
Example:
*** Browser is on http://my.domain.com:3000/hello/world.html
/* cssWalker.js
*
* Traverse every stylesheet in the document and filter based on their selectors.
*
* @Requires: Nothing, completely standalone.
*
* @Returns: An array of style objects/rules. The order of the array is determined by the point
* of the stylesheet in the document - e.g, first stylesheet rules are top of the array.
*
* @Author: Ryan McGrath (ryan@webs.com)