Skip to content

Instantly share code, notes, and snippets.

View eAmin's full-sized avatar
:octocat:

Amin Akbari eAmin

:octocat:
View GitHub Profile
@eAmin
eAmin / gist:3415934
Created August 21, 2012 14:21 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@eAmin
eAmin / Grep.js
Created January 28, 2013 11:33 — forked from nicdaCosta/Grep.js
/*
Grep.js
Author : Nic da Costa ( @nic_daCosta )
Created : 2012/11/14
Version : 0.2
(c) Nic da Costa
License : MIT, GPL licenses
Overview:
Basic function that searches / filters any object or function and returns matched properties.
@eAmin
eAmin / dabblet.css
Created December 19, 2013 15:35 — forked from LeaVerou/dabblet.css
/**
* (C)Leanest CSS spinner ever
*/
@keyframes spin {
to { transform: rotate(1turn); }
}
.progress {
position: relative;
@eAmin
eAmin / dabblet.css
Created December 19, 2013 15:38 — forked from LeaVerou/dabblet.css
/* Polygon kitties - By @LeaVerou */
div {
display: inline-block;
position: relative;
width: 200px;
height: 200px;
margin: 40px;
overflow: hidden;
backface-visibility: hidden; /* hack to make it smoother, suggested by Mottie */
@eAmin
eAmin / dabblet.css
Created December 19, 2013 15:39 — forked from LeaVerou/dabblet.css
/**
* iMessage-style loader
*/
@keyframes fade {
to { background: rgba(0,0,0,.1); }
}
.progress,
.progress:before,
@eAmin
eAmin / dabblet.css
Created December 19, 2013 15:43 — forked from LeaVerou/dabblet.css
/**
* Getting the month names from the browser
*/
@eAmin
eAmin / ParentChild.es6
Created July 29, 2018 13:54 — forked from sebkouba/ParentChild.es6
Basic example to pass values between parent and child components in React.
/**
* Basic example to pass values between parent and child components in React
* Seems to be in line with this
* http://stackoverflow.com/questions/24147331/react-the-right-way-to-pass-form-element-state-to-sibling-parent-elements
* Now I have the state in parent and child. Is that good or bad? Why would I need it in child?
* Could probably take that out
* */
class Parent extends React.Component {
constructor(props) {
super(props);
@eAmin
eAmin / k8s-pi.md
Created August 5, 2018 08:51 — forked from alexellis/k8s-pi.md
K8s on Raspbian

Kubernetes on (vanilla) Raspbian Lite

Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system called Raspbian. This means you can carry on using all the tools and packages you're used to with the officially-supported OS.

Pre-reqs:

  • You must use an RPi 2 or 3 for use with Kubernetes
  • I'm assuming you're using wired ethernet (Wi-Fi also works, but it's not recommended)

Master node setup

@eAmin
eAmin / remote react bootstrap table example
Created August 22, 2018 20:21 — forked from xabikos/remote react bootstrap table example
An example of a react bootstrap table that fetches the data asynchronously when navigating between pages and when changing the page size
import React, {Component} from 'react';
import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table';
import _ from 'lodash';
const dataTable = _.range(1, 60).map(x => ({id: x, name: `Name ${x}`, surname: `Surname ${x}`}));
// Simulates the call to the server to get the data
const fakeDataFetcher = {
fetch(page, size) {
return new Promise((resolve, reject) => {
@eAmin
eAmin / download.js
Created August 22, 2018 22:46 — forked from falkolab/download.js
Download file by http with progress (NodeJS)
function download(fileUrl, apiPath, callback) {
var url = require('url'),
http = require('http'),
p = url.parse(fileUrl),
timeout = 10000;
var file = fs.createWriteStream(apiPath);
var timeout_wrapper = function( req ) {
return function() {