Skip to content

Instantly share code, notes, and snippets.

Ilea Cristian ileacristian

Block or report user

Report or block ileacristian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View robot.c
#include <Servo.h>
int rotatePin = 2;
int verticalPin = 5;
int horizontalPin = 3;
int clawPin = 4;
bool initialized = false;
Servo servoRotate;
View logger.swift
func myLog(message: String, function: String = __FUNCTION__, file: String = __FILE__, line: Int = __LINE__) {
println("Message: \(message)\ \n(From file: \(file), Function: \(function), Line: \(line))")
}
// Ex. apel
myLog("Salut")
// Exemplu de output
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
View test_exception.py
def foo():
# corpul functiei
raise ValueError("Acesta este mesajul exceptiei")
try:
# bloc pentru codul "suspect"
foo()
except ValueError as exception:
# cod pentru tratarea exceptiei
print(exception.args[0]) # afisam primul argument al exceptiei
View test_gcd.py
def test_gcd():
assert gcd(0, 2) == 2
assert gcd(2, 0) == 2
assert gcd(2, 3) == 1
assert gcd(2, 4) == 2
assert gcd(6, 4) == 2
assert gcd(24, 9) == 3
try:
gcd(-2, 0)
gcd(0, -2)
@ileacristian
ileacristian / sir.rb
Created Jun 11, 2011
just some test code
View sir.rb
sir = gets
array = sir.split
hash = {}
for i in array do
hash[i] = 0
end
for i in array do
hash[i]+=1
end
View bot.rb
require 'rubygems'
require 'mechanize'
require 'nokogiri'
file = File.open( File.join('','Users','Ilea Cristian','Desktop','test.html'), 'w')
agent = Mechanize.new
agent.user_agent_alias = 'Mac Safari'
agent.follow_meta_refresh = true
You can’t perform that action at this time.