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
struct foo { | |
int a; | |
int b; | |
}; | |
struct bar { | |
int c; | |
int d; | |
}; |
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
source :rubygems | |
group :development do | |
gem 'pry' | |
end | |
gem 'yajl-ruby' | |
gem 'em-synchrony' | |
gem 'em-http-request' |
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
require 'active_record' | |
ActiveRecord::Base.establish_connection(adapter: "sqlite3", | |
database: ":memory:") | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Schema.define do | |
create_table :widgets do |t| | |
t.string :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
;;; WIP, somewhat usable | |
(require 'company) | |
(require 'pos-tip) | |
(defun company-quickhelp-frontend (command) | |
"`company-mode' front-end showing documentation in a | |
`pos-tip' popup." | |
(pcase command | |
(`post-command (company-quickhelp--set-timer)) | |
(`hide |
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
#import <Foundation/NSObject.h> | |
@interface Fraction: NSObject { | |
int numerator; | |
int denominator; | |
} | |
-(void) print; | |
-(void) setNumerator: (int) n; | |
-(void) setDenominator: (int) d; |
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
;;; noisy-typer.el --- Make noises when typing -*- lexical-binding: t -*- | |
;; This file is not part of GNU Emacs. | |
;; This file is free software: you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or | |
;; (at your option) any later version. | |
;; This file is distributed in the hope that it will be useful, |
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
require 'excon' | |
# require 'webmock' | |
# WebMock.allow_net_connect! | |
s = StringIO.new("muffins") | |
resp = Excon.put("http://localhost:9292", request_block: lambda { s.read(2).to_s }) | |
puts resp.body |
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
require 'benchmark' | |
class Bob | |
def hey(msg) | |
case msg | |
when nil, "" | |
"Fine. Be that way!" | |
when /\A[^a-z]+\z/ | |
"Woah, chill out!" | |
when /\?\z/ |
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
(setq company-frontends '(company-echo-strip-common-frontend) | |
company-require-match nil | |
company-backends '(company-capf)) | |
(define-key company-mode-map (kbd "C-M-i") 'company-complete) |
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
require "sinatra" | |
require "pry" | |
enable :sessions | |
set :session_secret, "cupcakes" | |
get "/" do | |
session[:sheep] ||= 0 | |
session[:sheep] += 1 | |
erb :index |
NewerOlder