MD5: 59bab8f71f8c096cd3f72cd73851515d
Rename it to: Sublime Text
Make it executable with: chmod u+x Sublime\ Text
#!/usr/bin/env ruby | |
# c-prog | |
# $ ./ns32 {43fa330c-4ec6-4440-a924-bd21b406b0ea} Test654321 | |
# WDOfQ7VONESfJIghgAaD6j4zy0M= | |
# | |
# ruby-prog | |
# => "WDOfQ7VONESfJIghgAaD6j4zy0M=" | |
require 'base64' | |
require 'securerandom' |
let(:pod) do | |
pod = Kubeclient::Pod.new | |
pod.metadata = {} | |
pod.kind = 'Pod' | |
pod.apiVersion = 'v1beta1' | |
pod.id = @id | |
pod.desiredState = {} | |
pod.desiredState.manifest = {} | |
pod.desiredState.manifest.version = 'v1beta1' | |
pod.desiredState.manifest.containers = [{ |
def get_endpoint(id) | |
endpoint = get_node_config('load-balancer', 'hostname') | |
begin | |
ip = Resolv.getaddress(endpoint) | |
response = open("http://#{ip}", 'HOST' => "#{id}.#{endpoint}").read | |
rescue StandardError | |
return false | |
end |
import io.undertow.Undertow | |
import io.undertow.server.HttpHandler | |
import io.undertow.server.HttpServerExchange | |
import io.undertow.util.Headers | |
object server extends App { | |
val server: Undertow = Undertow.builder().addHttpListener(8080, "localhost").setHandler(new HttpHandler() { | |
override def handleRequest(exchange: HttpServerExchange): Unit = { | |
exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain") | |
exchange.getResponseSender().send("Hello, world!") |
{ | |
"auto_complete": true, | |
"auto_complete_commit_on_tab": true, | |
"bold_folder_labels": true, | |
"caret_style": "solid", | |
"theme": "Spacegray Eighties.sublime-theme", | |
"color_scheme": "Packages/User/base16-eighties.dark (SL).tmTheme", | |
"dictionary": "Packages/User/russian_english.dic", | |
"font_face": "InputMonoNarrow Thin", | |
"font_size": 14.0, |
(by @andrestaltz)
So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
#!/bin/sh | |
# Disabling SELinux if enabled | |
if [ -f "/usr/sbin/getenforce" ] && [ `id -u` = 0 ] ; then | |
selinux_status=`/usr/sbin/getenforce` | |
/usr/sbin/setenforce 0 2> /dev/null | |
fi | |
INSTALLDIR=/opt/metasploit |
I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.
In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.
While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.
Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio