Skip to content

Instantly share code, notes, and snippets.

Pontus Lundin hontas

View GitHub Profile
@hontas
hontas / Edited.md
Last active Jun 11, 2020
Notes from React Europe in Paris 2019
View Edited.md

ReactEurope

Thursday 23/5-19

Jared Palmer - State of React

2019 roadmap

  • Suspense for data fetching
  • A new server renderer
View vs code JS snippets.json
{
"console.log": {
"prefix": "c",
"body": [
"console.log('$1', ${2:$1});"
]
},
"import": {
"prefix": "imp",
"body": [
@hontas
hontas / gist:3955052
Created Oct 25, 2012
HTML/CSS3: Star Wars Crawl
View gist:3955052
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
body {
background: black;
color: yellow;
font-family: Helvetica;
@hontas
hontas / Gruntfile.js
Created Jan 26, 2014
Gruntfile setup with proxies, fakeEnd and Express server
View Gruntfile.js
/*global module:false*/
var proxySnippet = require('grunt-connect-proxy/lib/utils').proxyRequest;
module.exports = function(grunt) {
grunt.initConfig({
// Task configuration.
express: {
dev: {
options: {
@hontas
hontas / pre-push
Created Dec 1, 2017
pre-push hook linting changed files and running test + checkstyle
View pre-push
#!/usr/bin/env bash
printf "<pre-push>\n";
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$BRANCH" = "master" ]]; then
cd frontend;
FRONTEND_DIFF=`git diff-index --name-only --relative origin/master`;
if [ "$FRONTEND_DIFF" ];
then
printf "Frontend files changed: \n$FRONTEND_DIFF\n";
@hontas
hontas / index.js
Created May 24, 2017
fetch handler
View index.js
const NO_CONTENT = 204;
const getHeaders = {
'accept': 'application/json'
};
const postHeaders = {
'Content-Type': 'application/json'
};
export function getJSON(url) {
return fetch(url, { headers: getHeaders })
View notifications.styl
.notifications {
// Used for calculations
$defaultWidth = 320;
$success = $brand-happy;
$error = $brand-angry;
$warning = $warning;
$info = $brand-turquoise;
$defaultShadowOpacity = "0.9";
&-wrapper {}
@hontas
hontas / ES7.js
Created Jan 21, 2016
Some snippets of ES7
View ES7.js
function makeRequest(id) {
return new Promise((resolve, reject) => {
setTimeout(() => {
if (id % 2) {
resolve(id);
} else {
reject(id);
}
}, 400);
});
@hontas
hontas / EmberFooterComponent.js
Last active Jan 4, 2016
Ember footer component with bubbling actions
View EmberFooterComponent.js
App.MemModuleFooterComponent = Ember.Component.extend({
tagName: 'footer',
classNames: ['mem-module-footer'],
actions: {
clearErrorMsg: function() {
this.set('errorMsg', '');
},
save: function() {
this.sendAction('save');
},
@hontas
hontas / server.js
Created Jan 26, 2014
Express server for fakeEnd
View server.js
var express = require('express'),
fs = require('fs'),
app = express(),
port = 8080;
function getInt (num) {
return parseInt(num, 10);
}
function readJSONFile (path, callback) {
You can’t perform that action at this time.