Skip to content

Instantly share code, notes, and snippets.

View litehacker's full-sized avatar
🚀
Works on RN + Firebase

Giorgi Gvimradze litehacker

🚀
Works on RN + Firebase
View GitHub Profile
@mdvacca
mdvacca / Text.js
Last active February 28, 2020 10:53
Custom ReactNative Text component that handles lineHeight correctly in Android.
/**
* Custom Text that handles lineHeight correctly in Android
* @flow
*/
'use strict';
import React from 'react';
import RN, { StyleSheet, Dimensions, Platform } from 'react-native';
type Props = any;
@maheshmurthy
maheshmurthy / Voting.sol
Last active June 6, 2023 21:20
Simple solidity contract to vote for a candidate and see the results
pragma solidity ^0.6.4;
// We have to specify what version of compiler this code will compile with
contract Voting {
/* mapping field below is equivalent to an associative array or hash.
The key of the mapping is candidate name stored as type bytes32 and value is
an unsigned integer to store the vote count
*/
mapping (bytes32 => uint256) public votesReceived;
@timsueberkrueb
timsueberkrueb / yoga910-fix-screen-flickering.md
Last active February 8, 2023 19:44
Fix Screen Flickering on Ubuntu on Lenovo Yoga 910

Fix Screen Flickering on Ubuntu on Lenovo Yoga 910

  • Edit /etc/default/grub

    • Add i915.enable_rc6=0 GRUB_CMDLINE_LINUX_DEFAULT
    • Run sudo update-grub
    • Reboot (optional)
  • Create and edit ~/.drirc:

@EduVencovsky
EduVencovsky / Auth.jsx
Last active June 27, 2024 07:58
Private Routes with Auth using react-router and Context API
import React, { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import { checkIsAuthenticated, authSignUp, authLogin, authLogout } from '../../services/auth'
export const AuthContext = React.createContext({})
export default function Auth({ children }) {
const [isAuthenticated, setIsAuthenticated] = useState(false)
const [isLoading, setIsLoading] = useState(true)
@claraj
claraj / git_submodule_fix.md
Last active July 13, 2024 14:09
Fixing git submodule AKA git repo inside another git repo

Problem, and symptoms:

You experience one or more of these symptoms

  • you have code in a directory but it's not being pushed to GitHub. You just see an empty directory icon
  • you see this message when you add code to your git repository from the command prompt
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.