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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define int(x) *((int *) x) | |
int main() { | |
void *a[2]; | |
char *b = "hello"; |
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
words = [line.strip().lower() for line in open('/usr/share/dict/words')] | |
words = [i for i in words if "q" in i] | |
w = [] | |
for i in words: | |
if i.replace("q", "o") in words: | |
w.append(i) | |
print i | |
print len(w) |
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 | |
/* | |
* Bitstorm - A small and fast Bittorrent tracker | |
* Copyright 2012 Peter Caprioli <[email protected]> | |
* | |
* This program 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 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
class Brightswipe < Sinatra::Base | |
configure do | |
enable :run | |
set :app_file, __FILE__ | |
set :views, "#{settings.root}/../views" | |
$pubdir = "public/i" | |
unless File.directory? "public" | |
Dir.mkdir "public" | |
unless File.directory? $pubdir |
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 | |
# Read _why's SPOOL in real time. | |
# Requires `lp` and a printer. | |
BASEURL=http://whytheluckystiff.net | |
if [ ! -d SPOOL ]; then | |
mkdir SPOOL | |
fi |
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 type="text/javascript"> | |
function htmlEscape(str) { | |
return String(str) | |
.replace(/&/g, '&') | |
.replace(/"/g, '"') | |
.replace(/'/g, ''') | |
.replace(/</g, '<') | |
.replace(/>/g, '>'); | |
} |
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
<h1 id="how-to-install-and-get-started-with-sinatra">How to install and get started with Sinatra</h1> | |
<h2 id="introduction">Introduction</h2> | |
<hr /> | |
<p>Sinatra is a simple and lightweight web framework written in Ruby. This article assumes you know basic Ruby and have Ruby and RubyGems installed on your system. Using Ruby Version Manager (RVM) is preferable.</p> | |
<h3 id="its-not-rails-what-is-it">It's not Rails. What is it?</h3> | |
<p>Sinatra is similar to Ruby on Rails in that they are both web frameworks. It's pretty different from Rails in that it's much lighter (less overhead), and you have more fine-grained control over your webapp. Additionally, there is no built-in database functionality or page rendering — all of that is done manually.</p> | |
<h3 id="why-sinatra-then">Why Sinatra, then?</h3> | |
<p>It's fast. It's simple. It's efficient. There is less to be learned. It allows flexibilty that Rails does not. However, with that comes more work and more room for error.</p> | |
<p>Sinatra is best used for smaller |
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 'data_mapper' | |
require 'dm-postgres-adapter' | |
require 'pry' | |
#DataMapper.setup :default, ENV['HEROKU_POSTGRESQL_AQUA_URL'] | |
DataMapper.setup :default, 'postgres://uwgnmutktlckej:uACT6pxYLaDg7qDYh7PlQYOVLo@ec2-54-235-173-50.compute-1.amazonaws.com:5432/degihk3bc71vk4' | |
class User | |
include DataMapper::Resource |
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 'data_mapper' | |
require 'dm-postgres-adapter' | |
require 'pry' | |
#DataMapper.setup :default, ENV['HEROKU_POSTGRESQL_AQUA_URL'] | |
DataMapper.setup :default, 'postgres://uwgnmutktlckej:uACT6pxYLaDg7qDYh7PlQYOVLo@ec2-54-235-173-50.compute-1.amazonaws.com:5432/degihk3bc71vk4' | |
class User | |
include DataMapper::Resource |
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 'pp' | |
class ShitVM | |
attr_accessor :regs | |
attr_reader :ops | |
def initialize | |
@regs = {} | |
@ops = { | |
:loadi => ->(reg, val) { |
OlderNewer