Skip to content

Instantly share code, notes, and snippets.

View manuelbieh's full-sized avatar
⚛️
Available for hire! Berlin. React.

Manuel Bieh manuelbieh

⚛️
Available for hire! Berlin. React.
View GitHub Profile
const glob = require('glob');
const fs = require('fs');
const files = glob.sync(process.cwd() + '/{src,config,scripts}/**/*.{js,jsx,ts,tsx}', {nodir: true});
const letterCount = files
.map((file) => fs.readFileSync(file, { encoding: 'utf-8'}))
.map((fileContent) => fileContent.split(''))
.reduce((acc, lettersOfFile) => {
lettersOfFile.forEach((letter) => {
acc[letter] = acc[letter] ? acc[letter]+1 : 1;
onChange = (e: React.ChangeEvent) => {
e.persist();
const {
target: { checked, name, type, value },
} = e;
if (!name && process.env.NODE_ENV === 'development') {
console.warn(
`Change event with value '${value}' happened for an element without name prop. This is probably by mistake.`
);
@manuelbieh
manuelbieh / actions.js
Created June 18, 2018 11:39
request/success/failure
// @flow
import type { Dispatch } from 'redux';
import { ClientRequest } from 'services/api';
import { getTeamId } from 'store/team/selectors';
import isClient from 'shared/utils/isClient';
export const ActionTypes = {
ACCESS_TOKEN_REQUEST: 'auth/access-token/request',
ACCESS_TOKEN_SUCCESS: 'auth/access-token/success',
ACCESS_TOKEN_FAILURE: 'auth/access-token/failure',
@manuelbieh
manuelbieh / imagick.txt
Created October 20, 2011 10:51
Install PHP PECL Imagick on Ubuntu 10.04
Because I'm always struggling, a note for myself (and for others) how it works.
Installing PHP PECL IMagick on Ubuntu:
--------------------------------------
1. $ sudo aptitude install php-pear imagemagick php5-dev libmagick9-dev
2. $ sudo pecl install Imagick
3. $ sudo nano /etc/php5/apache2/php.ini
4. enter extension=imagick.so -> save (ctrl+x / Y)
5. $ sudo apache2ctl configtest
function tick(time) {
const element = (
<div>
<h1>Hello, world!</h1>
<h2>It is {time}.</h2>
</div>
);
ReactDOM.render(element, document.getElementById('root'));
}
function tick() {
const time = new Date().toLocaleTimeString();
const element = (
<div>
<h1>Hello, world!</h1>
<h2>It is {time}.</h2>
</div>
);
ReactDOM.render(element, document.getElementById('root'));
}
// @flow
import React from 'react';
import classNames from 'classnames';
import { connect } from 'react-redux';
import { translate } from 'react-i18next';
import { CheckboxGroup, Checkbox } from 'react-checkbox-context';
import { Dropdown, Trigger, Content } from 'react-minimal-dropdown';
import MenuList, { Item } from 'components/MenuList';
import { activeAndApprovedUsers } from 'store/users/selectors';
import { updateFilter } from 'store/suggestions/actions';
alias iotalog="journalctl -u iota -f"
alias iotainfo="curl http://localhost:14265 -X POST -H 'Content-Type: application/json' -H 'X-IOTA-API-Version: 1.4' -d '{\"command\": \"getNodeInfo\"}' | jq"
alias iotaneighbors="curl http://localhost:14265 -X POST -H 'Content-Type: application/json' -H 'X-IOTA-API-Version: 1.4' -d '{\"command\": \"getNeighbors\"}' | jq"
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2016-10-10 18:25:59" build="161002">
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{Bash::CygWin bash}"/>
<value name="StartFarFolders" type="hex" data="00"/>
<value name="StartFarEditors" type="hex" data="00"/>