Skip to content

Instantly share code, notes, and snippets.

@admataz
admataz / machine.js
Created November 16, 2020 21:54
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@admataz
admataz / react-native-ycm-notes-no3.md
Created June 16, 2020 22:44
YCM React Native learning notes no.3 - 16 June 2020

YCM React Learning session no.3

16 Jun 2020

Here’s a quick recap of what we covered and some links and resources going forward.

Setting up the development environment

  • We revisited the set up to make sure we all could run build the apps and view them on our phones with Expo and React Native.
  • The guide at Expo — Learn how is a good place to go for step by step instructions
  • Also, we needed to be sure to have the Expo client installed on our phone.
@admataz
admataz / react-native-ycm-initial-workshop.md
Last active June 12, 2020 00:16
notes and resources, introducing young coders to React and React Native

React Native learning resources

Here are a few notes, and a couple resources to help you on your way. There is a lot of good stuff on the web - tutorials and videos, and the official docs are really well made.

If you have any questions or thoughts - please let me know on the next call.

Here’s what we coverered:

Introduction to some of the concepts behind React and React Native

@admataz
admataz / react-native-ycm-notes.md
Last active June 5, 2020 20:15
YCM - React Native notes - 05 June

YCM Sign 2 Word - React Native notes 5 June

1. Using Tensorflow.js in react native apps

Good news! there’s a module that will help with Tensorflow ML stuff made for React Native apps: @tensorflow/tfjs-react-native - npm

From the introduction it looks like it will support most of what you need for Sign2Word - and works well with Expo managed apps too

These points seemed relevant:

has full support for training and fine tuning models that TensorFlow.js supplies. You can customize models based on user data while keeping that data on the client device.

We can't make this file beautiful and searchable because it's too large.
row,pid,question,speaker,eval_answer_overall,eval_answer_expertise,eval_candidate_prospect,eval_candidate_collegiality,eval_candidate_overall,eval_mean,condition,pd_region_1,pd_region_2,pd_class_1,pd_class_2,mcpr_1,mcpr_2,mcpr_3,ud_1,ud_2,pd_region,pd_class,mcpr_short,P_gender,P_age,P_ethn,P_ethn_spec,P_UK_born,P_country_birth,P_UK_length_living,P_UK_growup,P_other_native,P_other_native_spec,P_postcode_growup,P_growup_district,P_growup_region,P_postcode_residence,P_residence_district,P_residence_region,P_region,P_self_accent,P_self_accent_change,P_self_occup,P_mom_occup,P_dad_occup,P_edu,P_circle_ethn_sim,P_circle_class_sim,P_ENG_native,Al_familiarity,Al_region,Al_interaction,Al_accent_similarity,DD_familiarity,DD_region,DD_interaction,DD_accent_similarity,GM_familiarity,GM_region,GM_interaction,GM_accent_similarity,JS_familiarity,JS_region,JS_interaction,JS_accent_similarity,PE_familiarity,PE_region,PE_interaction,PE_accent_similarity
1,1067870293,1,DD,8,7,7,7,7,7.2,9,5,5,5,5,5,5,2,5,2,5,5,4,1,71,1,NA,1,NA,N
@admataz
admataz / hasCamera.js
Last active June 20, 2019 21:27
has camera hook
const [hasCamera, setHasCamera] = useState(false);
useLayoutEffect(() => {
navigator.mediaDevices
.getUserMedia({ video: true })
.then(hasCamera => setHasCamera(true))
.catch(err => setHasCamera(false));
}, []);
<div>
<h1>Adam Davis</h1>
<h2>admataz</h2>
</div>
<div>
<p>Like all forms of human communication, code for computer programs can contain expressiveness, humour, beauty, ugliness… As a coder you recognise beautiful code as a passage that does something with data using brevity and efficiency, where meaning and capability are neatly tucked into a clear and concise passage. That is poetry.</p>
</div>
<img src="https://images.unsplash.com/photo-1559183061-1fd53f7c93e9?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ" height="300" />
@admataz
admataz / global-restrictions.conf
Created November 3, 2018 11:45
wordpess running on nginx with https behind a load balancer
include global/restrictions.conf;
# Global restrictions configuration file.
# Designed to be included in any server {} block.
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
@admataz
admataz / logPropsChange.js
Created September 12, 2018 21:55
enhancer for recompose to log which props changed in a react component's update
const shouldUpdate = ((props, nextProps) => {
console.log({props})
console.log({nextProps})
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== props[key]
})
.map(key => {
console.log(
'changed property:',
@admataz
admataz / generator-pagination.js
Created October 6, 2017 14:31
access a complete paginated recordset, iterating one page at a time using a generator function
/**
* Generator for iterating paginated results
*/
function * Paginator () {
let next = true
let item = null
while (next) {
if (item) {
item = yield item.page + 1
} else {