This file contains hidden or 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
| BEGIN; | |
| create function app.change_notify() | |
| returns trigger | |
| language plpgsql | |
| as $$ | |
| declare | |
| channel_name text := coalesce(TG_ARGV[0], 'app_' || TG_TABLE_NAME || '_' || lower(TG_OP)); | |
| begin | |
| if TG_OP = 'INSERT' or TG_OP = 'UPDATE' then |
This file contains hidden or 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
| import { compose, withProps } from 'recompact'; | |
| import { Form } from 'antd'; | |
| import moment from 'moment'; | |
| import transform from 'utils/transform'; | |
| import withInitialFormValues from './withInitialFormValues'; | |
| export default compose( | |
| Form.create(), | |
| withProps(transform('data.node.birthday', moment)), | |
| withInitialFormValues, |
This file contains hidden or 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
| import PropTypes from 'prop-types'; | |
| import { compose, withPropsOnChange, setPropTypes } from 'recompact'; | |
| export default compose( | |
| setPropTypes({ | |
| data: PropTypes.shape({ | |
| node: PropTypes.object.isRequired, | |
| }).isRequired, | |
| form: PropTypes.shape({ | |
| getFieldDecorator: PropTypes.func.isRequired, |
This file contains hidden or 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
| #!/bin/bash | |
| find . -type f \ | |
| | grep -v 'node_modules\|semantic/src\|semantic/tasks' \ | |
| | xargs -P5 -L1 -I{} curl -s --user youruser:yourpassword --ftp-create-dirs -T {} ftp://xxx/blog/wp-content/themes/best/{} |
This file contains hidden or 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
| set role api; set session app.current_user_id to 1; select * from app_users; | |
| id | first_name | |
| ----+------------ | |
| 1 | john | |
| 2 | max | |
| set role api; set session app.current_user_id to 2; select * from app_users; | |
| id | first_name |
This file contains hidden or 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
| import time | |
| import subprocess | |
| def set_speed(val): | |
| print(val) | |
| subprocess.call('bash -c "echo 1 > /sys/devices/platform/applesmc.768/fan1_manual"', shell=True) | |
| subprocess.call('bash -c "echo ' + str(val) + ' > /sys/devices/platform/applesmc.768/fan1_output"', shell=True) | |
| while True: | |
| print("start") |
This file contains hidden or 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
| 0xaa0a5080987b85575ef596f64f98ed229a3391d7 |
This file contains hidden or 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
| var { createStructuredSelector } = require("reselect") | |
| const ide = { | |
| tabs: [], | |
| activeTab: null, | |
| sidebarInitialSize: 100, | |
| sidebarTab: 'schema', | |
| contents: {}, | |
| }; |
This file contains hidden or 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
| Float screenX = event.position().x() / 1280.f; | |
| Float screenY = event.position().y() / 1024.f; | |
| Float nx = (2.0f * screenX) - 1.0f; | |
| Float ny = 1.0f - (2.0f * screenY); | |
| Vector4 midPoint(nx, ny, 0.0f, 1.0f); | |
| Matrix4 inv = (_camera->projectionMatrix() * _camera->cameraMatrix()).inverted(); | |
| Vector3 eye = _cameraObject->transformation().translation(); |
This file contains hidden or 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
| // ... | |
| bool canJump = false; | |
| bool canLeft = true; | |
| bool canRight = true; | |
| for (b2ContactEdge* ce = _playerBody->GetContactList(); ce; ce = ce->next) { | |
| b2Contact* c = ce->contact; | |
| if (c->IsTouching()) { |