Skip to content

Instantly share code, notes, and snippets.

View eyalcohen4's full-sized avatar
🏠
Working from home

Eyal Cohen eyalcohen4

🏠
Working from home
View GitHub Profile
cmake_minimum_required(VERSION 3.10)
project(obs_headless_poc)
set(obs_include_dir ${CMAKE_CURRENT_SOURCE_DIR}/obs-studio/libobs/)
set(obs_lib_dir ${CMAKE_CURRENT_SOURCE_DIR}/obs-studio/build/libobs/)
include_directories(/home/myplay/dev/obs-headless-poc/obs-studio/libobs)
link_directories(/home/myplay/dev/obs-headless-poc/obs-studio/build/libobs)
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : 0.3333333432674408,
"Red Component" : 0.3333333432674408,
"Blue Component" : 1
},
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/student/public_html
ServerName test.eyal.website
Redirect permanent / https://test.co.il
<Directory /var/www/student/public_html>
Options FollowSymLinks
AllowOverride All
Require all granted
selection: #607d8b
background: #263238
foreground: #eceff1
bold: #eeeeee
links: #005cbb
html {
height: 100vh;
}
body {
background-color:lightcyan;
margin: 0;
padding: 0;
height: 100%;
}
@eyalcohen4
eyalcohen4 / App.js
Created April 27, 2018 14:26
Preventing Transitions in react router 4
import React from 'react';
class App extends Component {
this.unblock = this.props.history.block(nextLocation => this.getShouldBlockTransition(nextLocation));
getShouldBlockTransition = nextLocation => {
// shouldBlock is a boolean which represent if history should block/not to block.
// If set to true, the user wont be able to exit, and on false he will.
return shouldBlock;
}
class WizardContainer extends Component {
state = {
shouldRenderWizard: true
}
toggleWizard = () => this.setState(prevState => ({ shouldRednerWizard: !prevState.shouldRenderWizard }));
render() {
return this.state.shouldRenderWizard ? <Wizard onDismiss={this.toggleWizard} /> : null;
}
@eyalcohen4
eyalcohen4 / RequiredPropInsideShape.js
Last active January 16, 2018 15:48
Demonstration of feature req. in prop-types
const props = {
unrequiredShape: PropTypes.shape({
requiredStringInShape: PropTypes.string.isRequired
})
}
// At the top of our file
import { MaterialIcons, Octicons } from '@expo/vector-icons';
// In our App class
render() {
const { width } = Dimensions.get('window');
return (
<View style={styles.container}>
<View>
export default class App extends React.Component {
state = {
mute: false,
shouldPlay: true,
}
handlePlayAndPause = () => {
this.setState((prevState) => ({
shouldPlay: !prevState.shouldPlay
}));