Skip to content

Instantly share code, notes, and snippets.

View deadcoder0904's full-sized avatar
:octocat:
Dead

a2k deadcoder0904

:octocat:
Dead
View GitHub Profile
@kiok46
kiok46 / modify_color_of_tabs.md
Last active August 6, 2017 14:27
Change the Color of Custom tabs when they change.

modify_color_of_tabs

Change the Color of Custom tabs when they change.

  • handleTabNavigation method that changes the state which leads to re-render the UI and hence the colors.
  handleTabNavigation = (route, idx) => {
      if (this.state.storiesTabOpen && idx === 0 || this.state.searchTabOpen && idx === 1){
          this.setState({ searchTabOpen: !this.state.searchTabOpen,
@kiok46
kiok46 / NoItemComponent.md
Created June 28, 2017 17:41
Display a nice Component when no Items are available to show.

NoItemComponent

Display a nice Component when no Items are available to show.

import React, { Component } from 'react';
import { Text, View, Dimensions, StyleSheet } from 'react-native';
import { FontAwesome } from '@expo/vector-icons';
import Colors from '../constants/Colors';
@evantahler
evantahler / buildSitemap.js
Last active December 17, 2020 16:35
35 lines to build a sitemap for next.js projects
#! /usr/bin/env node
// I am ./bin/buildSitemap.js
const path = require('path')
const glob = require('glob')
const fs = require('fs')
const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com'
const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js')
const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml')
abandoned
able
absolute
adorable
adventurous
academic
acceptable
acclaimed
accomplished
accurate
@alphamu
alphamu / Android Privacy Policy Template
Created February 9, 2017 03:17
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@gauravtiwari
gauravtiwari / window-auth-popup.es6.js
Last active December 5, 2024 18:40
Promise based popup window for server oAuth
/* global window */
const popup = (url) => {
const windowArea = {
width: Math.floor(window.outerWidth * 0.8),
height: Math.floor(window.outerHeight * 0.5),
};
if (windowArea.width < 1000) { windowArea.width = 1000; }
if (windowArea.height < 630) { windowArea.height = 630; }
@deadcoder0904
deadcoder0904 / samba.md
Last active November 10, 2016 16:26
Enabling Samba Service to connect to Ubuntu using ES File Explorer in Android

Trick samba into thinking that every remote user is you ( at least as far as that share is concerned ) by doing something like this:

Press Alt+F2 & Type this in Terminal

sudo gedit /etc/samba/smb.conf

In the [global] section add the following line:

force user = bob

@wesbos
wesbos / commit-msg
Created July 4, 2016 18:55
ESLint 3.0 Git Pre Commit Hook
#!/bin/bash
files=$(git diff --cached --name-only | grep '\.jsx\?$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
failed=0
for file in ${files}; do