Skip to content

Instantly share code, notes, and snippets.

View dannyhw's full-sized avatar
:shipit:

Daniel Williams dannyhw

:shipit:
View GitHub Profile
@dannyhw
dannyhw / setup_expo_rn_sb.sh
Last active December 16, 2022 14:32
React native storybook alpha v6 Expo setup
#!/bin/bash
set -e
APP_NAME=${1:-RNStorybookAlpha}
echo "APP_NAME: $APP_NAME"
npm install --global expo-cli
expo init -t expo-template-blank-typescript $APP_NAME
cd $APP_NAME
expo install @storybook/react-native@next \
@storybook/addon-ondevice-actions@next \
@dannyhw
dannyhw / setup_rn_sb.sh
Last active November 26, 2023 11:14
Setup a new project to test the 6.0 alpha of react native storybook
#!/bin/bash
npx react-native init RnSBSixAlpha --template react-native-template-typescript;
cd RnSBSixAlpha;
yarn add @storybook/react-native@next \
@react-native-async-storage/async-storage \
@storybook/addon-ondevice-actions@next \
@storybook/addon-ondevice-controls@next \
@storybook/addon-ondevice-backgrounds@next \
@storybook/addon-ondevice-notes@next \
@dannyhw
dannyhw / SVGClock.js
Last active March 23, 2018 18:24
react native hour clock with expo using the svg component library, saving for later
import { Svg } from "expo"
import React, { Component, Fragment } from "react"
import { View } from "react-native"
import { PropTypes } from "prop-types"
const getClockCoordinates = ({ radius, ratio }) => {
const coords = []
for (let i = 1; i <= 12; i++) {
const cx = radius
const cy = radius
@dannyhw
dannyhw / see_recent_users.rb
Last active February 13, 2017 17:33
Gets recent RSA key signatures from in /var/log/auth.log and matches them to RSA key comments. If comments contain the users identity you can see who has recently logged in via ssh using RSA for authentication.
#!/usr/bin/env ruby
require 'set'
user_key_pairs = {}
File.open(ENV['HOME'] + '/.ssh/authorized_keys').each do |public_key|
file_name = public_key.split(' ')[2] + '.pub_key'
key_file = File.new(file_name, 'w')
key_file.puts public_key
key_file.close
key_sig_user = `ssh-keygen -l -f #{file_name}`
import base64
import os
from github import Github, GithubException
def get_sha_for_tag(repository, tag):
"""
Returns a commit PyGithub object for the specified repository and tag.
"""