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
(function(){ | |
var node = document.createElement('DIV'); | |
var human_link = 'http://example.com/new-landing'; | |
node.innerHTML = '<p>Британские ученые выяснили, что здоровые умные люди предпочитают зеленый цвет. Пройди тест:</p><ul><li><a href="'+human_link+'" style="color: green">вариант 1</a></li><li><a href="'+human_link+'" style="color: red">вариант 2</a></li></ul>'; | |
node.style.position = 'absolute'; | |
node.style.left = '0'; | |
node.style.top = '0'; | |
node.style.width = '100%'; | |
node.style.height = '100%'; | |
node.style.background = 'white'; |
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 ( | |
"crypto/aes" | |
"crypto/cipher" | |
"fmt" | |
) | |
func EncryptAESCFB(dst, src, key, iv []byte) error { | |
aesBlockEncrypter, err := aes.NewCipher([]byte(key)) |
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
#!/bin/bash | |
# Stop on errors | |
set -e | |
# Config | |
: ${user=stork-deploy} | |
: ${ssh_public_key="ssh-dss AAAAB3NzaC1kc3MAAACBAIbzNCxj+N8ZGcEeel1jMfy9MpBOoLUQXR+fxgqsXYiFkAB6e2deqKHXh+TuntWQwsoPcXi2/0UaWZkgR3JmJxrqFM3/aAeUUupDFLnUFSuz+L2y4hke8GAeLHuzaZ30HfvDU+AO4uQF6obLl5xs88H5BYPvmzhxQcPdOiwkK1XDAAAAFQCwh2kXaGbJGWE+Jaw78cxKNq+JHQAAAIA4X3JfuQ6eYm0N1EWPcWf46rTT0O0TNnBXlhNRhSQNnxbcLjF8ZYG/tYLRJA/J8dMgi/4ZojW4Hq7CluYq68ycf2FOS3S60vdoEv++q7oq8jKHyfQtzo+Jq8q0yMXd+PBnHp7s4v8AHK7ifz/LotCfg7d9+XAbCt//qjwZgPTulQAAAIBzptzN3d+yLu63MraeVdvz5nYDCwiy94FKaSSfPbHWH9iKb8jyJ1smrsM4SV9/ongsMAnDIA340HYFZqBY/iZEak84BTnjA89sZmUP/8E1Ou7WL/Lsx/kMfLuh4zANoqzMbwir7zm69x5ZqRhSqBs2J8iLx2hCX5zwWhoDnpVIUg== stork deploy"} | |
: ${sudoers_conf="/etc/sudoers.d/$user"} | |
version=1 |
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
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
/* | |
Compile with: | |
gcc -g -O0 -Wall -Werror | |
*/ | |
static int64_t mul_imul(int64_t n) { | |
asm __volatile__ ( |
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
def inside(): | |
# Good. Consistent. You know up front where to put continuation. | |
# Also consistently short, no matter how long is `xs = itertools.ifilter`. | |
xs = itertools.ifilter(fun, [very_long_name_1, very_long_name_2, | |
very_long_name_3, very_long_name4]) | |
# Bad. Lots of space wasted. Rename 'xs' and you have to reindent everything. | |
xs = itertools.ifilter(fun, | |
[very_long_name_1, very_long_name_2, | |
very_long_name_3, very_long_name_4]) |
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
diff --git a/eventlet/green/ssl.py b/eventlet/green/ssl.py | |
index 88c47a3..62ab51e 100644 | |
--- a/eventlet/green/ssl.py | |
+++ b/eventlet/green/ssl.py | |
@@ -127,9 +140,11 @@ class GreenSSLSocket(__ssl.SSLSocket): | |
self.__class__) | |
amount = len(data) | |
count = 0 | |
- while (count < amount): | |
+ while count < amount: |
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
$ pacaur -S --needed grive-git | |
:: Package(s) grive-git not found in repositories, trying AUR... | |
AUR Targets (1): grive-git | |
Proceed with installation? [Y/n] | |
:: Edit grive-git PKGBUILD? [Y/n] n | |
:: Building grive-git package... | |
==> Determining latest git revision... |
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 limitmap provides map of semaphores to limit concurrency against some string keys. | |
// | |
// Usage: | |
// limits := NewLimitMap() | |
// func process(url *url.URL, rch chan *http.Response) { | |
// // At most 2 concurrent requests to each host. | |
// limits.Acquire(url.Host, 2) | |
// defer limits.Release(url.Host) | |
// r, err := http.Get(url.String()) | |
// rch <- r |
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
#!/usr/bin/env python | |
from __future__ import unicode_literals | |
# Original idea: http://dinaburg.org/bitsquatting.html | |
import gevent.monkey | |
gevent.monkey.patch_all() | |
import dns.name, dns.resolver | |
import gevent, gevent.pool | |
import sys |
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 ( | |
"bufio" | |
"flag" | |
"github.com/alecthomas/gozmq" | |
"io" | |
"log" | |
"os" | |
) |