Skip to content

Instantly share code, notes, and snippets.

View gminova's full-sized avatar
:octocat:
Focusing

Gergana ゲルガナ gminova

:octocat:
Focusing
View GitHub Profile
@gminova
gminova / regex-japanese.txt
Created September 20, 2024 10:53 — forked from terrancesnyder/regex-japanese.txt
Regex for Japanese
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@gminova
gminova / scrollbars.md
Created July 15, 2020 12:19 — forked from martynchamberlin/scrollbars.md
On the Width of Scroll Bars on Mac and Windows

How It Works on Mac

By default, scroll bars do not appear on Mac except when the user is scrolling and when there is hidden content. You can double check this by going to System Preferences -> General -> Show scroll bars: Automatically based on mouse or trackpad.

When you do scroll, the width of viewport and the available width of the inner content does not change from what it was. If the width was 300 pixels, it still is 300 pixels.

If you change the "Show scroll bars" setting to "Always" then the scrollbar takes up a decided amount of width - 16 pixels to be precise.[^1] Let's say your browser height is 300 pixels and your broswer width is also 300 pixels. With this setting, if you toggle the height of the body from 300 to 600, causing scrollableness, then a scrollbar will appear only have you have done the toggle. The width of your body will have gone from 300 to 284 pixels, because the scrollbar takes up space in a way that it did not in the other setting. Interestingly, if you're talking about

@gminova
gminova / react-redux.jsx
Last active November 26, 2019 13:27
FCC - React Redux App
// Redux:
const ADD = 'ADD';
const addMessage = (message) => {
return {
type: ADD,
message: message
}
};
@gminova
gminova / manage_state_locally.jsx
Created November 26, 2019 11:07
FCC - React Input List ToDo
class DisplayMessages extends React.Component {
constructor(props) {
super(props);
this.state = {
input: '',
messages: []
}
this.handleChange = this.handleChange.bind(this)
this.submitMessage = this.submitMessage.bind(this)
}
@gminova
gminova / toDoReduxApp.jsx
Created November 25, 2019 17:50
FCC - Redux Never Mutate State ToDo App
const ADD_TO_DO = 'ADD_TO_DO';
// A list of strings representing tasks to do:
const todos = [
'Go to the store',
'Clean the house',
'Cook dinner',
'Learn to code',
];
@gminova
gminova / counter_redux.jsx
Created November 25, 2019 17:45
FCC - Redux Counter App
const INCREMENT = 'INCREMENT';
const DECREMENT = 'DECREMENT';
const counterReducer = (state = 0, action) => {
switch (action.type) {
case INCREMENT:
return (state += 1);
break;
case DECREMENT:
return (state -= 1);
@gminova
gminova / reduxThunk_async_actions.jsx
Created November 25, 2019 16:51
FCC - ReduxThunk Async Actions
const REQUESTING_DATA = 'REQUESTING_DATA'
const RECEIVED_DATA = 'RECEIVED_DATA'
const requestingData = () => { return {type: REQUESTING_DATA} }
const receivedData = (data) => { return {type: RECEIVED_DATA, users: data.users} }
const handleAsync = () => {
return function(dispatch) {
store.dispatch(requestingData())
setTimeout(function() {
@gminova
gminova / action_data.jsx
Created November 25, 2019 16:25
FCC - Redux Send Action Data To The Store
const ADD_NOTE = 'ADD_NOTE';
const notesReducer = (state = 'Initial State', action) => {
switch(action.type) {
case ADD_NOTE:
return action.text;
break;
default:
return state;
}
@gminova
gminova / combine_reducers.jsx
Created November 25, 2019 16:16
FCC - Redux.combineRedicers()
const INCREMENT = 'INCREMENT';
const DECREMENT = 'DECREMENT';
const counterReducer = (state = 0, action) => {
switch(action.type) {
case INCREMENT:
return state + 1;
case DECREMENT:
return state - 1;
default:
@gminova
gminova / store_subscribe.jsx
Created November 25, 2019 16:03
FCC - Redux store.subscribe(func)
const ADD = 'ADD';
const reducer = (state = 0, action) => {
switch(action.type) {
case ADD:
return state + 1;
default:
return state;
}
};