This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.` | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tick(time) { | |
const element = ( | |
<div> | |
<h1>Hello, world!</h1> | |
<h2>It is {time}.</h2> | |
</div> | |
); | |
ReactDOM.render(element, document.getElementById('root')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"/> |