Skip to content

Instantly share code, notes, and snippets.

View hrgui's full-sized avatar

Harman Goei hrgui

View GitHub Profile
@hrgui
hrgui / readme.md
Last active April 14, 2017 04:15
JSX to TSX

So you want to do TSX?

instructions

install "@types/node": "^7.0.12",

modify webpack.config.dev.js

@hrgui
hrgui / vscode-settings.json
Created April 6, 2017 15:17
vscode-settings.json
// Place your settings in this file to overwrite the default settings
{
"editor.tabSize": 2,
"files.associations": {
".css": "sass",
"*.html": "html"
},
"terminal.integrated.shell.osx": "/bin/zsh",
"workbench.colorTheme": "Monokai",
"window.zoomLevel": 0,
@hrgui
hrgui / ajax-test.html
Last active March 25, 2017 04:31
Timeout test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script src="node_modules/setImmediate/setImmediate.js"></script>
@hrgui
hrgui / Pagination.jsx
Created December 5, 2016 01:36
Pagination in react
import React from 'react';
let howManyToShowAtATime = 5;
export default ({elementLength, start, howMany, onPageClicked}) => {
let numberOfPages = Math.ceil(elementLength / howMany);
let pageLinkNodes = [];
let previousNode, nextNode;
let previousTextNode = <span>Prev</span>;
let nextTextNode = <span>Next</span>;
let onPageClickHandler = (start) => {
@hrgui
hrgui / gist:5e2147461da967ce99c2
Last active August 29, 2015 14:26
Awesome Angular Resources
@hrgui
hrgui / checkAllDemo.html
Last active August 29, 2015 14:02
This demonstrates and is the implementation of a simple check all use case in angular.js. I got the idea from http://plnkr.co/edit/IQA9kq?p=preview, but I did not want to have to depend on underscore, so it is a solution without it.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-app="todoApp">
<div ng-controller="TodoCtrl as todoList">
Select All <input type="checkbox" ng-checked="todoList.isCheckedAll()" ng-click="todoList.checkAll()" />