Skip to content

Instantly share code, notes, and snippets.

@beakr
beakr / disable_intro_message.vim
Created March 29, 2012 16:05
How to disable Vim intro message.
set shortmess=I " Read :help shortmess for everything else.
@beakr
beakr / comment_box.css
Created March 30, 2012 12:54
Expanding nice comment box.
.comment_box {
/* Cosmetic */
margin-left: 30px;
margin-top: 50px;
border-radius: 7px;
border-color: #BABABA;
box-shadow: 1px 5px 2px #EDEDED;
height: 130px;
width: 300px; /* Was 470px */
@beakr
beakr / search.css
Created March 30, 2012 02:04
Nice search bar (hand made).
.search {
/* Roundness */
border: 1px solid #BABABA;
border-radius: 20px;
height: 35px;
width: 300px;
padding: 8px;
background: white;
@beakr
beakr / opene.sh
Last active December 7, 2021 23:39
Open Windows file explorer on a directory with Cygwin.
#!/bin/bash.exe
# This script opens a given directory up in the Windows file explorer. I did
# this to make it easy when opening directories in the Cygwin system using
# the explorer.
#
# To install:
#
# $ touch /usr/bin/opene
# $ vim /usr/bin/opene
@beakr
beakr / UnrealLogging.cc
Created April 2, 2014 18:50
Simple debug logging macros for Unreal Engine 4.
/**
* Log a green debug message in the corner of the game screen. Generally
* used for situations in which an operation has completed successfully.
*/
#define BL_LOG_GREEN(str) (GEngine->AddOnScreenDebugMessage(-1, 5.f, \
FColor::Green, \
TEXT(str)))
/**
* Log a yellow debug message in the corner of the game screen. Generally
@beakr
beakr / vocab.txt
Created December 21, 2014 01:50
Popular vocabulary used on 2chan (translated to English). Source: http://services.4-ch.net/2chportal/
* AA — Abbrev for "ASCII Art", actually JIS art.
* aborn あぼーん — Post deleted. Occasionally also 〜する "to administratively delete a post".
* age — To reply to a thread and thus bump a thread to the top of the board. From 上げる. Written in romaji but inflected like a verb, e.g. ageろ "let's age".
* appu うp — "Upload please!". Like "zOMG TORRENT PLZ" but less annoying.
* arashi 荒し — Troll.
* burakura ブラクラ — Browser crusher. Things or people who post things which break web browsers.
* chūbō 厨房 — Posters who don't bother to read the rules, flamers, spammers. From kanji misconversion of 中坊 "middle school kid", an abbrev for 中学坊主 or 中学坊や. 坊主 is an everyday slang term for "kid", from the short haircuts of young boys and bald heads of Buddhist priests.
* denpa 電波 — Literally "radio waves". Songs and similar things which get stuck in your head, e.g. マイヤヒ.
* desu tane デス種 — Abbrev for Gundam Seed Destiny.
* DQN ドキュン — Retard, asshole, jerk, troll. Also ドキュソ.
@beakr
beakr / gist:2941446
Created June 16, 2012 14:18
Copy to OSX clipboard from text field (Objective-C).
NSPasteboard *pasteBoard = [NSPasteboard generalPasteboard];
[pasteBoard declareTypes:[NSArray arrayWithObjects:NSStringPboardType, nil] owner:nil];
[pasteBoard setString: [_textField stringValue] forType:NSStringPboardType];
@beakr
beakr / Zip.cpp
Created September 26, 2014 05:45
void Zip::Open(const char * file)
{
int error = 0;
// Allocate a buffer that holds the error message string from
// zip_error_to_str.
char buffer[250];
// Open the zip file. Essentially it writes data to the `z' struct
// that holds all the zip file data.
z = zip_open(file, ZIP_CREATE, &error);
@beakr
beakr / arg_example.rb
Created January 12, 2014 22:31
Rake task arguments example with evil hacks
# From: http://itshouldbeuseful.wordpress.com/2011/11/07/passing-parameters-to-a-rake-task/
def task_arg(var)
task var.to_sym {}
end
task :hello do
name = ARGV.last # Get last arg (ARGV.first is task name)
abort "I can't say hello to nobody. :(" if name.empty?
puts "Hello #{name}!"
def f;m=%,He#{:ll}o #{?w+?o}rld\n,;s=(:a1[1].to_i)-0.5;;m.split(//)
.each{|c|print((->{%?#{c}?}.call));sleep(s)};
puts((%Q%#{?t+?h}%+%?a?+%{t w#{"aa"[1]}s boring...}));;end;f;