Skip to content

Instantly share code, notes, and snippets.

View envp's full-sized avatar

Vaibhav Yenamandra envp

View GitHub Profile
@envp
envp / buggy_breakout.c
Created April 15, 2015 18:55
This works but has a lot of stability issues and this wierd issue: http://a.pomf.se/sfpubq.gif
//
// breakout.c
//
// Computer Science 50
// Problem Set 3
//
// standard libraries
#define _XOPEN_SOURCE
#include <stdio.h>
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
README.ext
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/tags/v1_8_6/README.EXT?revision=12055
Extending Ruby - Pickaxe
http://ruby-doc.org/docs/ProgrammingRuby/html/ext_ruby.html
Extending Ruby on O'Reilly
http://onlamp.com/pub/a/onlamp/2004/11/18/extending_ruby.html
Ruby C Extensions - Mark Volkman
@envp
envp / gist:8117414
Created December 24, 2013 20:12
What it's supposed to look like
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'net/http'
class NokoLinkSet < Nokogiri::XML::NodeSet
# Create new LinkSet object from the url and the selector
def initialize(url, selector)
if not ( url.nil? and selector.nil? )
@raw_html = open(url)
--->->>->++++++++++++++++++++++++++++>++>-->+>++
+++++>++>-->++++++++++++++++++>+++++++>+++++++++
++++++++++++>-->++++++++>+++++++++>++++++++++>++++++++>+++++
+>++++++++++++>++++++>+>+++++++>++++++++++>+++++>-->++++++++
+>++++++>++>->++++++++++++>++>+++++++++++++>-->++++++++>>+++
++++++++++>-->++++++++++++++>>+++++++++++>+>+++++++++
@envp
envp / lastdig.c
Created June 20, 2013 08:36
SPOJ Problem Set (classical) 3442. The last digit Problem code: LASTDIG http://www.spoj.com/problems/LASTDIG/
#include <stdio.h>
#include <math.h>
int main() {
int t, a, b, b2, b4, s, p;
scanf("%d", &t);
typedef double d;
while(t--) {
scanf("%d %d", &a, &b);
a %= 10;
b2 = (b>2)?b%2:b;