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
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"/>
@manuelbieh
manuelbieh / sequelize-schema-file-generator.js
Last active January 16, 2024 19:25
Automatically generates migration files from your sequelize models
import * as models from "models";
import Sequelize from "sequelize";
import fs from "fs";
delete models.default;
const sequelize = new Sequelize(
'',
'',
'', {
@manuelbieh
manuelbieh / sequelize-migration-file-generator.js
Created January 14, 2016 16:42
Creates migration files for existing sequelize models
import * as models from "models";
import fs from "fs";
for(let model in models) {
let attributes = models[model].attributes;
for(let column in attributes) {
delete attributes[column].Model;
delete attributes[column].fieldName;
@manuelbieh
manuelbieh / ng-prefixer.es6
Last active October 29, 2015 13:24
Change all ng-* attributes to data-ng-*
Array.from(document.querySelectorAll('*')).forEach((el) => {
Array.from(el.attributes).forEach((attrib) => {
if(attrib.localName.startsWith('ng-')) {
el.setAttribute(`data-${attrib.localName}`, attrib.value);
el.removeAttribute(attrib.localName);
}
});
});
@manuelbieh
manuelbieh / sequelize-scope-inheritance.js
Created October 20, 2015 09:35
Sequelize scope with limit fixed
import Sequelize from 'sequelize';
let sequelize = new Sequelize('test', 'root', '', {
host: 'localhost',
dialect: 'sqlite',
storage: __dirname + '/database.sqlite',
logging: console.log,
}
);
@manuelbieh
manuelbieh / sequelize-limit-error-sqlite.js
Last active October 19, 2015 23:43
Sequelize hasMany error when used with limit
import Sequelize from 'sequelize';
let sequelize = new Sequelize('test', 'root', '', {
host: 'localhost',
dialect: 'sqlite',
storage: __dirname + '/database.sqlite',
logging: console.log,
}
);