Skip to content

Instantly share code, notes, and snippets.

View Zensavona's full-sized avatar
💁‍♀️
😏

Zen Savona Zensavona

💁‍♀️
😏
View GitHub Profile
@Zensavona
Zensavona / flatten.js
Created December 20, 2018 03:28
Flatten Array JS
const flatten = list => list.reduce(
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []
)
const array = [[1,2,[3]],4]
flatten(array) // [ 1, 2, 3, 4 ]
# in real life you probably won't store the file on disk, you'll just let users upload it in phoenix
# and have it's value available as a variable
alias NimbleCSV.RFC4180, as: CSV
# if you're reading from disk
"path/to/csv/file"
|> File.stream!(read_ahead: 100_000)
|> CSV.parse_stream
|> Stream.map(fn [name, age] ->
export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.5
export M2=$M2_HOME/bin
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=$M2:$PATH
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
@Zensavona
Zensavona / app.html
Created September 1, 2016 00:19 — forked from jdanyow/app.html
Aurelia RequireJS Gist
<template>
<h1>${message}</h1>
</template>
Zens-MacBook-Air z/webpack_integration ‹master*› » mix phoenix.server 1 ↵
[info] [Porcelain]: goon executable not found
[info] [Porcelain]: falling back to the basic driver.
[info] [Porcelain]: (set `config :porcelain, driver: Porcelain.Driver.Basic` or `config :porcelain, goon_warn_if_missing: false` to disable this warning)
[info] Running WebpackIntegration.Endpoint with Cowboy using http on port 4000
/usr/local/lib/node_modules/react-stdio/server.js:41
let render
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
rotocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:523) [hornetq-core-client-2.3.20.Final-redhat-1.jar:2.3.20.Final-redhat-1]
at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:564) [hornetq-server-2.3.20.Final-redhat-1.jar:2.3.20.Final-redhat-1]
at org.hornetq.core.remoting.impl.invm.InVMConnection$1.run(InVMConnection.java:159) [hornetq-server-2.3.20.Final-redhat-1.jar:2.3.20.Final-redhat-1]
at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:105) [hornetq-core-client-2.3.20.Final-redhat-1.jar:2.3.20.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]
03:54:55,882 ERROR [org.hornetq.core.server] (Thread-2231 (HornetQ-remoting-threads
@Zensavona
Zensavona / what.js
Created October 29, 2012 05:22
For Pete
function say(word) {
console.log(word);
}
function execute(someFunction, value) {
someFunction(value);
}
execute(say, "Hello");
@Zensavona
Zensavona / js.js
Created October 29, 2012 05:10
What the actual fuck
function say(word) {
console.log(word);
}
function execute(someFunction, value) {
someFunction(value);
}
execute(say, "Hello");