Skip to content

Instantly share code, notes, and snippets.

View j-hannes's full-sized avatar
💭
hello world

Johannes Erber j-hannes

💭
hello world
View GitHub Profile
@j-hannes
j-hannes / server.js
Last active March 23, 2016 10:03
Ask github for logins of most recent repositories
const fetch = require('isomorphic-fetch')
const async = require('async')
const range = require('ramda').range
const url = 'https://api.github.com/search/repositories?q=+language:javascript'
const listOccurences = names => {
const occurences = {}
names.forEach(name => {
if (name in occurences) {
@j-hannes
j-hannes / server2.js
Created March 23, 2016 11:04
Request github in batches of 30
const fetch = require('isomorphic-fetch')
const R = require('ramda')
const url = 'https://api.github.com/search/repositories?q=+language:javascript'
const listOccurences = names => {
const occurences = {}
names.forEach(name => {
if (name in occurences) {
occurences[name] = occurences[name] + 1
@j-hannes
j-hannes / index.html
Last active May 14, 2016 10:57
HTML to include Main.elm
<!doctype html>
<html>
<head>
<title>my first elm app</title>
</head>
<body>
<div id="app"></div>
<script src="app.js"></script>
<script>
@j-hannes
j-hannes / Main.elm
Last active May 15, 2016 17:03
Post 2 Version A
module Main exposing (..)
import Html exposing (button, div, span, text)
import Html.Events exposing (onClick)
type Action
= Increment
| Decrement
main =
@j-hannes
j-hannes / package.json
Created May 16, 2016 20:41
for redux counter
{
"name": "react-redux-counter",
"version": "1.0.0",
"description": "A simple counter in react+redux",
"dependencies": {
"react": "^15.0.2",
"react-dom": "^15.0.2",
"redux": "^3.5.2"
},
"devDependencies": {
@j-hannes
j-hannes / .babelrc
Created May 16, 2016 20:50
for redux counter
{
"presets": [
"es2015",
"react"
]
}
@j-hannes
j-hannes / Main.diff
Last active May 21, 2016 18:22
Counter V0-V1
module Main exposing (..)
import Html exposing (button, div, span, text)
+ import Html.App as Html
main =
+ view
+
+ view =
@j-hannes
j-hannes / index.html
Last active May 21, 2016 20:23
for redux counter
<!doctype html>
<html>
<head>
<title>simple react+redux counter</title>
</head>
<body>
<div id="app"></div>
<script src="bundle.js"></script>
</body>
</html>
@j-hannes
j-hannes / webpack.config.js
Last active May 21, 2016 20:24
for redux counter
module.exports = {
entry: './app.js',
output: {
path: './',
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
@j-hannes
j-hannes / Counter.elm
Last active May 21, 2016 20:32
Counter v1
module Counter exposing (..)
import Html exposing (button, div, span, text)
main =
div []
[ button [] [ text "-" ]
, span [] [ text "0" ]
, button [] [ text "+" ]