Skip to content

Instantly share code, notes, and snippets.

Andrei Puni andrei512

Block or report user

Report or block andrei512

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 trie.swift
import Foundation
protocol Alphabet {
associatedtype AlphabetCharacter: Comparable, Hashable
func allCharacters() -> [AlphabetCharacter]
init()
View mincost.c
#include <stdio.h>
#define NNodes 22
int Sum, Min, x, y, n, m, c, f[NNodes], st[NNodes], a[NNodes][NNodes];
void back(int k) {
if(k == n + 1) {
if(a[st[n]][st[1]] > 0) {
Sum += a[st[n]][st[1]];
View objc_prop.rb
prop_regex = /@property\s*\([^\)]+\)\s+(?<type>\w+(\s*\*)?)\s*(?<name>\w+)/
code = `pbpaste`
property_list = []
code.scan(prop_regex) do |match|
type, name = match
View parallax fun.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>A pure CSS parallax demo by Keith Clark</title>
<style>
/* Parallax base styles
@andrei512
andrei512 / doc.rb
Created Apr 25, 2015
the ruby code that won the ccc
View doc.rb
require 'socket'
MAX_DIST = 120
@s = TCPSocket.new 'localhost', 7000
def get_number_of_rods
@s.puts "GET_NUMBER"
@s.gets.split.map(&:to_i)
end
View loto_andrei.swift
var n = 12
var bile = [3, 4, 6, 7, 8, 9, 2, 1, 10, 18, 22, 26]
var extrase = [2, 9, 3, 4, 22, 6]
extrase.sort(<)
bile.sort(<)
var minBall = extrase[0]
View hack.swift
class A {
}
class B {
}
var factory: [String:()->(AnyObject)] = [
"A" : {
View google_bot.rb
require 'watir'
require 'watir-webdriver'
require 'nokogiri'
# require 'os'
require 'json'
query_string = ARGV[0]
# if OS.linux?
# # no more ui
View gist:1709c3b6623cc77a4d65
def filterX(image, region):
return 1.0
def filterY(image, region):
return 2.0
_filters = {
"principalComponentX" : filterX,
"principalComponentY" : filterY
You can’t perform that action at this time.