Tests build confidence. Write 'em. They'll save your ass, and they'll let you take a chainsaw to your code without being afraid of unintended consequences.
This file contains hidden or 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
//Tower of Hanoi | |
//No of calls made for n disks is equal to pow(2,n) -1. | |
void hanoi(int n, char a, char c, char b) | |
{ | |
if(n==1) | |
{ | |
printf("\nShift disk 1 from %c to %c",a,c); | |
return ; | |
} |
This file contains hidden or 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
:⌉ | |
=⌉ | |
¦-) as opposed to | | |
☺ | |
☹ | |
☻ | |
⍣ | |
⍤ | |
⍥ om nom nom | |
⍨ |
This file contains hidden or 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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
This file contains hidden or 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
In response to all the responses to: | |
http://twitter.com/rtomayko/status/1155906157 | |
You should never do this in a source file included with your library, | |
app, or tests: | |
require 'rubygems' | |
The system I use to manage my $LOAD_PATH is not your library/app/tests |
This file contains hidden or 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
/* | |
* | |
* coderwall.js | |
* | |
* Code to display coderwall.com badges | |
* | |
*/ | |
var coderwallJSONurl ="http://www.coderwall.com/hermanjunge.json?callback=?"; | |
var height = 75; |
This file contains hidden or 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
# Simple and Stupid Ruby API for Coderwall.com | |
# Vivien Didelot <[email protected]> | |
require "open-uri" | |
require "json" | |
module CoderWall | |
class Achievement | |
attr_reader :name, :badge, :description |
This file contains hidden or 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
# rubygems DNS is temporarily down, if you're using ghost to manage local DNS | |
# munging, run the following: | |
ghost add rubygems.org 72.4.120.124 | |
ghost add production.s3.rubygems.org 207.171.181.231 | |
ghost add production.cf.rubygems.org 216.137.45.24 | |
# Don't forget to clear them out afterwards with: | |
# ghost delete_matching rubygems.org |
This file contains hidden or 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
-- | |
-- qt-support.lua | |
-- Support for Qt Framework for Premake | |
-- Copyright (c) 2011 Konstantin Tokarev | |
-- | |
-- Known limitations: | |
-- don't support static Qt builds yet (private links, lib order, plugins) | |
-- no support for Qt debug libs (Mac, Win) | |
-- only gmake | |
-- no Windows support yet |
This file contains hidden or 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 os, subprocess, base64 | |
import tornado.ioloop | |
import tornado.web | |
from tornado.options import define, options, parse_command_line | |
define("port",default=8888,type=int) | |
define("branch",default="master") | |
define("access",type=str,multiple=True) | |
class MainHandler(tornado.web.RequestHandler): |
OlderNewer