View streamingapp.scala
val conf = new SparkConf().setAppName(appName) // run on cluster
val ssc = new StreamingContext(conf, Seconds(5))
val sc = ssc.sparkContext
sc.setLogLevel("ERROR")
View ConnectivityMonitor.java
package xyz.android.amrro.example;
import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.OnLifecycleEvent;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
View class_decorator.ts
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
View gist:8ed09589e2aced596114102efe0cceb2
-- Table: risco.risco_config
-- DROP TABLE risco.risco_config;
CREATE TABLE risco.risco_config
(
parameter character varying(64) NOT NULL,
value_str character varying(128),
value_int integer,
CONSTRAINT risco_config_pkey PRIMARY KEY (parameter)
View debounce.js
/**
* debounce
* @param {Function} func
* @param {Number} wait Время (ms)
* @param {Boolean} immediate
* @return {Function} debounced
*
* Ограничивает вызовы функции "func" до тех пор, пока
* после вызова функции "debounced" не пройдёт время "wait".
*/
View baby_dragon_final.rb
class Dragon
attr_reader :name, :age # user cannot change it
def initialize(name)
@name = name
@age = 0
@hunger_level = 5 # 0-10, 10 being hungry, 0 being full
@tiredness_level = 5 # 0-10, 10 is max tired, 0 being awake/energetic
@happiness_level = 5 # 0-10, 10 being happy, 0 being sad
@thirst_level = 5 # 0-1, 0 is thirsty, 10 is full
View rest-server.py
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
View variables.go
// In Go, _variables_ are explicitly declared and used by
// the compiler to e.g. check type-correctness of function
// calls.
package main
import "fmt"
func main() {
View helpers.sh
# Filter lines containing word
cat file.extension | grep -v "IGNOREME" > outputFile.extension
View Home.js
import React, { Component } from 'react'
import { Sidebar } from '../theme'
class Home extends Component {
render(){
return (
<div id="wrapper">
<div id="main">
<div className="inner">
<section id="banner">