View gist:7ca162a0110be69a4a64

https://www.youtube.com/watch?v=cPbl26Fw-dk

  • Quer brincar de Eike Bastista nessa porra!
  • Matar um leão por dia.
  • Faca nos dentes
  • Sangue no olho
  • É matar ou morrer
  • Dando muque em macaco de gaveta
  • É largar mato na caçamba
  • Jogar terra na boca de carrapato
View vanilla-redux.js
// -------- declaration of Store, reducers, actions -------- --------
function createStore(reducers) {
let currentSubscribers = [];
const dispatch = (action) => {
const currentState = reducers[action.type](currentState, action);
for (let i = 0; i < currentSubscribers.length; i++) {
currentSubscribers[i](currentState);
}
View gist:c153dc55f4373fb2b8080d078b4d55f4
/*
* I saw this thread: http://stackoverflow.com/questions/840781/easiest-way-to-find-duplicate-values-in-a-javascript-array
* The solutions from gist:1305056 were elegant, but wrong. So here's mine:
*/
Array.prototype.unique = function(test) {
/* returns a new, sorted Array without duplicates */
if (!Array.isArray(this))
throw new TypeError("Array.prototype.unique must be called on an Array");
return this.slice(0).sort().filter( typeof test == "function"
? function(v, i, a) { return !i || !test(v, a[i-1]); }
View gist:1387854
/*
* I saw this thread: http://stackoverflow.com/questions/840781/easiest-way-to-find-duplicate-values-in-a-javascript-array
* The solutions from gist:1305056 were elegant, but wrong. So here's mine:
*/
Array.prototype.unique = function(test) {
/* returns a new, sorted Array without duplicates */
if (!Array.isArray(this))
throw new TypeError("Array.prototype.unique must be called on an Array");
return this.slice(0).sort().filter( typeof test == "function"
? function(v, i, a) { return !i || !test(v, a[i-1]); }
View Active Directory (LDAP) Python Timestamp.py
from datetime import datetime, timedelta
def to_timestamp(timestamp):
timestamp = float(timestamp[0])
seconds_since_epoch = timestamp/10**7
loc_dt = datetime.fromtimestamp(seconds_since_epoch)
loc_dt -= timedelta(days=369 * 365 + 89)
return loc_dt
View SHM Mapper SmartApp.groovy
/**
* SHM Mapper
*
* Copyright 2017 Josh Lyon
*
* This SmartApp works in unison with the custom SHM Mapper device type handler to copy Smart Home Monitor statuses to an
* attribute of a Thing. Even though SHM code is available on the SmartThings community, it was never officially approved
* for use in officially published SmartApps.
*
* In order to get around this, the SHM Mapper SmartApp copies SHM status to the attribute of a Thing so that Thing can be
View counts.csv
2013-07-01 16650
2013-07-02 22745
2013-07-03 21864
2013-07-04 22326
2013-07-05 21842
2013-07-06 20467
2013-07-07 20477
2013-07-08 21615
2013-07-09 26641
2013-07-10 25732
View counts.csv
2013-07-01 16650
2013-07-02 22745
2013-07-03 21864
2013-07-04 22326
2013-07-05 21842
2013-07-06 20467
2013-07-07 20477
2013-07-08 21615
2013-07-09 26641
2013-07-10 25732
View gist:509e7fb3e2bb9204b7586d6c613d02f3
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 230180 8020 ? Ss 20:34 0:02 /sbin/init
root 2 0.0 0.0 0 0 ? S 20:34 0:00 [kthreadd]
root 4 0.0 0.0 0 0 ? S< 20:34 0:00 [kworker/0:0H]
root 6 0.0 0.0 0 0 ? S< 20:34 0:00 [mm_percpu_wq]
root 7 0.0 0.0 0 0 ? S 20:34 0:02 [ksoftirqd/0]
root 8 0.2 0.0 0 0 ? S 20:34 0:20 [rcu_preempt]
root 9 0.0 0.0 0 0 ? S 20:34 0:00 [rcu_sched]
root 10 0.0 0.0 0 0 ? S 20:34 0:00 [rcu_bh]
root 11 0.0 0.0 0 0 ? S 20:34 0:00 [migration/0]
View attention_lstm.py
class AttentionLSTM(LSTM):
"""LSTM with attention mechanism
This is an LSTM incorporating an attention mechanism into its hidden states.
Currently, the context vector calculated from the attended vector is fed
into the model's internal states, closely following the model by Xu et al.
(2016, Sec. 3.1.2), using a soft attention model following
Bahdanau et al. (2014).
The layer expects two inputs instead of the usual one: