Skip to content

Instantly share code, notes, and snippets.

View alexandru-calinoiu's full-sized avatar
💭
Crafting

Calinoiu Alexandru Nicolae alexandru-calinoiu

💭
Crafting
View GitHub Profile
using System.Text;
public class KDoubleSubstrings
{
public int howMuch(string[] str, int k)
{
int result = 0;
StringBuilder stringBuilder = new StringBuilder();
foreach (string s in str)
using System;
using System.Globalization;
using System.Text;
public class MountainWalk
{
private string[] _areaMap;
private int _height;
@alexandru-calinoiu
alexandru-calinoiu / widget.js
Created December 7, 2012 16:20
Load tg widget
(function () {
var jQuery;
var token = "42";
var location = "<%= "http://#{ActionMailer::Base.default_url_options[:host]}/" %>";
if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.8.2') {
var script_tag = document.createElement('script');
script_tag.setAttribute("type", "text/javascript");
script_tag.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js");
if (script_tag.readyState) {
General layout:
root
lib
hw1
part1.rb
spec
hw1
part1_spec.rb
.rspec
Guardfile
@alexandru-calinoiu
alexandru-calinoiu / Comapnies.rb
Created September 14, 2012 13:09
Active admin company
ActiveAdmin.register Company do
index do
column "#", :id
column :name, :sortable => :"addresses.name"
column "Owner", :sortable => :"users.first_name" do |company|
company.owner.name
end
column "City", :print_city
column "State", :print_state
column :plan
@alexandru-calinoiu
alexandru-calinoiu / test
Created February 19, 2012 16:23
a closure example in CoffeScript
view = (message) ->
console.log(message)
variable = "first"
parentFunction = ->
variable = "second"
childFunction = ->
view variable
childFunction
@alexandru-calinoiu
alexandru-calinoiu / SleepSort
Created February 10, 2012 09:53
A C# implementation of Sleep Sort inspired by this talk http://www.infoq.com/presentations/Cool-Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace SleepSort
{
class Program
{