This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name VK video Data miner(bagulnik) | |
// @author boyo | |
// @description Жутко баджу и беру информацию о видео вконтакте, тестировался только в хроме | |
// @match http://vk.com/* | |
// ==/UserScript== | |
// Usage: добавь в браузер, зайди в видеозаписи на vk.com, набери в поиске запрос и смело нажимай "багульник вперед". | |
function addJQuery(callback) { | |
//выходим если это айфрейм |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
with open('simple.txt', 'r') as f: | |
words = re.findall(r'\w+', f.read()) | |
for w in sorted(list(set([(w, words.count(w)) for w in words])), key=lambda x: x[1]): | |
print "%20s -> %d" % w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"regexp" | |
"strings" | |
"sort" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
class deep_dict(dict): | |
def __init__(self, value=None): | |
if isinstance(value, dict): | |
for key in value: | |
self.__setitem__( | |
key, | |
deep_dict(value[key]) if isinstance(value[key], dict) else value[key] | |
) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
const MAX_DELTA = 0.01 | |
func isEnough(d float64) bool { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
slice := make([][]uint8, dy) | |
for iy := range slice { | |
slice[iy] = make([]uint8, dx) | |
for ix := range slice { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() int { | |
x, y := 0, 1 | |
return func() int { | |
new := x + y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "code.google.com/p/go-tour/reader" | |
type MyReader struct{} | |
func (r MyReader) Read(bytes []byte) (int, error) { | |
for i := range bytes { | |
bytes[i] = 65 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
type String string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"code.google.com/p/go-tour/pic" | |
"image" | |
"image/color" | |
) | |
type Image struct{} |
OlderNewer