Давай представим ситуацию, когда тебе, в зависимости от какой-то логики нужно вернуть данные разного типа, например есть такая функция:
def function(foo, bar)
result = if foo > bar
10
else
"wrong"
end
end
Давай представим ситуацию, когда тебе, в зависимости от какой-то логики нужно вернуть данные разного типа, например есть такая функция:
def function(foo, bar)
result = if foo > bar
10
else
"wrong"
end
end
Introduction | |
============ | |
Industry statistics as a whole have failed to improve much since 1968, when software engineering and | |
scientific management were introduced as means for resolving the "software crisis". Unfortunately | |
abandoned projects, cost/time overruns, and bloated, buggy software still dominate the landscape. | |
In spite of the efforts to mitigate this situation --like XP, agile, software craftsmanship or DDD-- the | |
reality is that a usual software project stack involves an increasingly larger number of programming | |
languages, DSLs, frameworks, systems, tools, techniques and processes, so it is a fact that the |
In this talk, I want to share my experience gained during the development of frontend applications in several programming languages.
I think it's not a secret for anybody that developing large JavaScript applications is not so easy as it seems at first glance. We all want something simpler and more reliable. Therefore, many developers and even entire companies switch to different, compiled in JavaScript, programming languages. The bulk of such transitions is accounted for TypeScript and flow, and often, developers faced with more problems than they were before.
I wasn't the exception. Moving to a new project, I started using TypeScript and was disappointed. Luckily in my next project I used ClojureScript and it was like everything is illuminated!
// works only for russian language but you can change arguments in meta.includes | |
// Open https://store.playstation.com/ru-ru/download/list and run script below | |
let games = []; | |
while ( | |
!document | |
.querySelector('.paginator-control__page-number--selected') | |
.nextElementSibling.classList.contains('paginator-control__arrow-navigation') |
#!/bin/bash +x | |
# Source: http://www.gabsoftware.com/tips/automatically-reconnect-to-your-vpn-on-linux/ | |
# Description: | |
# Make the script executable "chmod +x /path/to/the/script.sh | |
# Put the script in .profile or .bashrc so it can be run on user login: | |
# Example: echo "/path/to/the/script.sh start &" >> .bashrc | |
# The script can be bound to shortcut keys with these commands: | |
# /path/to/the/script.sh start # starts and monitors VPN connection |
#!/bin/sh | |
# CONFIGURATION | |
# 1. Go to @botfather and create a bot and use it's auth token as bot_token value | |
# 2. Create test channel, believe me, you need it | |
# 3. Set some url for your test channel | |
# 4. Add your bot to both channels, set their names in variables | |
# USAGE | |
# 1. Copy your markdown-formatted message into OS clipboard (Cmd+C) |
var page = require('webpage').create(), | |
url = 'http://example.com/'; | |
// Put the event handlers somewhere in the code before the action of | |
// interest (opening the page in question or clicking something) | |
// http://phantomjs.org/api/webpage/handler/on-console-message.html | |
page.onConsoleMessage = function(msg, lineNum, sourceId) { | |
console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")'); | |
}; |
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
/* Changes the readable line length in Obsidian Notes. Tested in Obsidian v1.0.0 | |
See https://gist.github.com/vii33/f2c3a85b64023cefa9df6420730c7531/f4ea845b240e94c9fcd47d456340f78208dab38f | |
*/ | |
body { | |
--file-line-width: 750px; | |
} |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"