This file contains hidden or 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
// ==ClosureCompiler== | |
// @output_file_name default.js | |
// @compilation_level ADVANCED_OPTIMIZATIONS | |
// ==/ClosureCompiler== | |
/** | |
* | |
* Secure Hash Algorithm (SHA1) | |
* http://www.webtoolkit.info/ | |
* |
This file contains hidden or 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
require "rubypython" | |
ENV["DJANGO_SETTINGS_MODULE"] = "settings" | |
ENV["PYTHONPATH"] = "." | |
RubyPython.start(:python_exe => ENV["PYTHON_EXECUTABLE_NAME"]) | |
RubyPython.import('imp').load_source("activate_this",File.join(File.dirname(RubyPython::Runtime.python), "activate_this.py")) | |
$versioning = RubyPython.import("staticutils.versioning") | |
$settings = RubyPython.import("django.conf").settings | |
$storage = RubyPython.import("django.core.files.storage") | |
$fs_storage = $storage.FileSystemStorage(location=$settings.VERSIONED_STATIC_ROOT) |
This file contains hidden or 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 <time.h> | |
#include <stdio.h> | |
int main() { | |
setenv("TZ", ":Europe/Berlin", 1); | |
tzset(); | |
struct tm t = {0,21,2,25,9,98,0,0,-1}; | |
struct tm t_min = {0,21,1,25,9,98,0,0,-1}; | |
struct tm t_max = {0,21,4,25,9,98,0,0,-1}; | |
printf("is_dst before: %d\n", t.tm_isdst); |
This file contains hidden or 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
/* | |
To create your own command you need: | |
1. create gist with name "prettydev" | |
2. write JS file in requirejs syntax, which returns object with functions. Like this example | |
To call it you need to write your github login, colon and command name. | |
For example: gugu:javascript 2+3 | |
*/ |
This file contains hidden or 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
POST /links/create/yourdoma.in HTTP/1.1 | |
Accept: application/json | |
Accept-Encoding: gzip, deflate | |
Authorization: WRZgCztHImJoqdWO | |
Connection: keep-alive | |
Content-Length: 38 | |
Content-Type: application/json | |
Host: shorturl.localhost | |
User-Agent: HTTPie/0.9.2 |
This file contains hidden or 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
<? | |
$url = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; | |
$escaped_url = htmlspecialchars( $url, ENT_QUOTES, 'UTF-8' ); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://api.short.cm/links"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); | |
curl_setopt($ch, CURLOPT_HEADER, FALSE); | |
curl_setopt($ch, CURLOPT_POST, TRUE); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, "{ | |
\"domain\": \"tuneup.fit\", |
This file contains hidden or 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
# To reproduce issue, call tasks.leak_channels.delay().get() | |
from celery import Celery, chord | |
app = Celery('tasks', broker='pyamqp://guest@localhost//', backend='redis://127.0.0.1/') | |
@app.task | |
def add(x, y): | |
return x + y | |
@app.task |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am gugu on github. | |
* I am kostenko (https://keybase.io/kostenko) on keybase. | |
* I have a public key ASBH4UFBHP2QbipSiuKorkmPKt7NBhzyt2WhGiulCn-kGAo | |
To claim this, I am signing this object: |
This file contains hidden or 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
{ | |
"totalClicks": 115, | |
"humanClicks": 0, | |
"clickStatistics": { | |
"labels": [ | |
"Mar'17", | |
"Apr'17", | |
"May'17", | |
"Jun'17", | |
"Jul'17", |
This file contains hidden or 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 random | |
import time | |
def intersection_with_loops(first_array, second_array): | |
result = [] | |
for first_element in first_array: | |
if first_element in second_array: | |
result.append(first_element) | |
return result |
OlderNewer