Skip to content

Instantly share code, notes, and snippets.

Chris beakr

Block or report user

Report or block beakr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@beakr
beakr / disable_intro_message.vim
Created Mar 29, 2012
How to disable Vim intro message.
View disable_intro_message.vim
set shortmess=I " Read :help shortmess for everything else.
@beakr
beakr / gist:2941446
Created Jun 16, 2012
Copy to OSX clipboard from text field (Objective-C).
View gist:2941446
NSPasteboard *pasteBoard = [NSPasteboard generalPasteboard];
[pasteBoard declareTypes:[NSArray arrayWithObjects:NSStringPboardType, nil] owner:nil];
[pasteBoard setString: [_textField stringValue] forType:NSStringPboardType];
View Zip.cpp
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 Jan 12, 2014
Rake task arguments example with evil hacks
View arg_example.rb
# 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}!"
View obfuscated.rb
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;
View gist:8288676
/Users/chris/.rvm/gems/ruby-2.0.0-p247/gems/kgio-2.8.1/lib/kgio_ext.bundle: [BUG] Segmentation fault
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin12.4.0]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
the more detail of.
@beakr
beakr / iecomment.html
Created Jan 4, 2014
UPDATE YOUR BROWSER LIEK NAOW.
View iecomment.html
<!--[if lte IE 7]>
<p>
Oops! Looks like your browser is <strong>outdated</strong>. This means that
you may not be able to view certain sites correctly. Please download a later
version of the software you use to browse the internet for the best experience.
</p>
<![endif]-->
@beakr
beakr / Gemfile
Created Jan 4, 2014
Simple Ruby code for parsing markdown in a directory (Github flavoured Markdown, that is).
View Gemfile
# Run 'bundle' in the command line afterward
source 'https://rubygems.org'
gem 'guard'
gem 'guard-rake'
gem 'rake'
gem 'rainbow'
gem 'github-markdown'
@beakr
beakr / button.qss
Created Dec 23, 2013
Fairly nice Qt buttons that can be easily made great with a few tweaks of the hex codes.
View button.qss
QPushButton {
color: white;
background-color: QLinearGradient(x1: 0, y1: 0,
x2: 0, y2: 0.15,
stop: 0 #31363a,
stop: 0.5 #2a2e32);
border: 1px solid #2a2e32;
border-radius: 10px;
}
@beakr
beakr / scripting_in_dendrite_lua.md
Last active Dec 31, 2015
How Dendrite scripting should work.
View scripting_in_dendrite_lua.md

Dendrite Lua Scripting: How it should work.

This is a simple page meant to be used for documentation-driven design in my Dendrite game engine. This is where I write some simple documentation and use it as a reference for implementing the code.

Linking

To link a script, select an entity in the game editor and click the 'link' dropdown button. Then click the menu item 'lua script'.

If you need to link a script to your scene, simply go to Game > World Settings or use command-shift-W (Mac) cntrl-shift-W (Windows/Linux) to attach a script to the current world.

You can’t perform that action at this time.