Skip to content

Instantly share code, notes, and snippets.

@wilfriedE
wilfriedE / Guessing_game.rb
Last active December 12, 2015 02:18
sample ruby guessing game.
puts "Pick the highest possible guessing number."
puts
range_limit = gets.chomp.to_i
puts
puts "How many tries would you like."
puts
max_tries = gets.chomp.to_i
random_number = rand(range_limit) + 1
guess = 0
tries = 0
@wilfriedE
wilfriedE / TransferSystem.c
Created March 15, 2013 15:17
Transfer system for CIM (PLTW)
#pragma config(Sensor, in1, Light, sensorReflection)
#pragma config(Sensor, dgtl1, Start, sensorTouch)
#pragma config(Sensor, dgtl2, End, sensorTouch)
#pragma config(Sensor, dgtl4, Rotations, sensorQuadEncoder)
#pragma config(Sensor, dgtl6, Stop, sensorTouch)
#pragma config(Motor, port2, runMotor, tmotorVex269, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/*
Project Title: Transfer System
#pragma config(Sensor, in1, lineFollower, sensorLineFollower)
#pragma config(Sensor, in2, potentiometer, sensorPotentiometer)
#pragma config(Sensor, in3, lightSensor, sensorReflection)
#pragma config(Sensor, dgtl1, limitSwitch, sensorTouch)
#pragma config(Sensor, dgtl2, bumpSwitch, sensorTouch)
#pragma config(Sensor, dgtl3, quad, sensorQuadEncoder)
#pragma config(Sensor, dgtl5, sonar, sensorSONAR_inch)
#pragma config(Sensor, dgtl12, green, sensorDigitalOut)
#pragma config(Motor, port2, rightMotor, tmotorVex269, openLoop)
#pragma config(Motor, port3, leftMotor, tmotorVex269, openLoop)
@wilfriedE
wilfriedE / about_me.rb
Last active December 16, 2015 03:29
About me. Though mainly ruby, has some mix language references.
class Me
def class
return "Human"
end
def greetings
print "HELLO WORLD"
puts
print "A little about me."
div {
border-radius: 5px;
}
#header {
z-index: 1;
position: fixed;
width: 97.5%;
margin-top: -20px;
height: 60px;
@wilfriedE
wilfriedE / TODO
Last active December 16, 2015 18:00
Fun List
*Make Zurb Foundation Template for TEDx website (Default version and Inverted Version)
*Make Bootstrap Template for TEDx website (Default version and Inverted Version)
Note: Simple html, css and Javascript version; if possible [Gem that will auto generate this
and allow user to select choices between Foundation || Bootstrap & Default || Inverted version.]
@wilfriedE
wilfriedE / rock_paper_scissors.js
Last active December 17, 2015 02:09
"Rock, Paper, Scissors" in JavaScript.
var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
}
/* CSS FRIENDLY BUTTONS*/
.button {
width: 10%;
color: #fff;/* MoDIFy to your content*/
text-decoration: none;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
@wilfriedE
wilfriedE / Web Development tools
Last active April 9, 2022 09:38
Cool tools for web dev projects
http://cssdb.co/ | Popular CSS Libraries
http://www.slidesjs.com/ | Simple for Slideshow
http://gridpak.com/ | CSS Grid
http://nick-jonas.github.io/windows/ | Fullscreen display
http://manos.malihu.gr/jquery-custom-content-scroller/ | Scrollbar
http://dfcb.github.io/BigVideo.js/ | Video Background
https://developers.google.com/youtube/youtube_player_demo | Customize Embed youtube player
http://fortawesome.github.io/Font-Awesome/ | Cool ICONS (works well with css)
http://aozora.github.io/bootmetro/index.html | Bootstrap Metro Style
http://designmodo.com/flat/ | Flat UI (Bootstrap Metro Style really..)
@wilfriedE
wilfriedE / toggle.rb
Last active December 19, 2015 05:48
Toggle true or false in Ruby
# Toggle in ruby a simple example
#we will first define the toggle method
#and it takes an argument and toggles the value of that argument
#(e.i either true or false)
def toggle(arg)
arg = !arg
end
#now let's set a variable to true