Skip to content

Instantly share code, notes, and snippets.

View benjaminadk's full-sized avatar
👩‍💻
forever coding

Benjamin benjaminadk

👩‍💻
forever coding
View GitHub Profile
@benjaminadk
benjaminadk / timer.js
Created November 12, 2018 01:12
Simple Timer
class Component extends React.Component {
constructor(props) {
super(props)
this.state = {
time: null
}
}
componentDidMount() {
@benjaminadk
benjaminadk / models.js
Last active November 26, 2018 19:36
chingu-7-data-model
const categories = ['react', 'jquery', 'angular', 'vue']
const subCategories = ['documentation', 'tutorial', 'book']
const user = {
id: String, // generated by db
username: String, // unique
password: String, // if we use text password
email: String, // unique
oauthId: String, // if we use oauth
@benjaminadk
benjaminadk / datamodel.graphql
Last active November 28, 2018 02:00
chingu7 graphql data model
type User {
id: ID! @unique
name: String!
email: String! @unique
image: String
password: String # tradition email/password login
oauthId: String # if oauth login is used
posts: [Post]
reviews: [Review]
createdAt: DateTime!
@benjaminadk
benjaminadk / video-data.js
Created February 14, 2019 03:37
video data for clone components tutorial
export default [
{
title: "Clone Components Video 1: YouTube Tags Long Title Example",
author: "Benjaminadk",
verified: false,
thumbURL:
"https://faketube.s3.amazonaws.com/user/cjs0bzggl1mzk0968blbwxie7/thumbnails/clone.jpeg",
previewURL:
"https://faketube.s3.amazonaws.com/user/cjs0bzggl1mzk0968blbwxie7/thumbnails/clone-components-youtube-tags-part-3-preview.gif",
duration: 459,
@benjaminadk
benjaminadk / thumbnail-creator.js
Created June 15, 2019 10:38
aws lambda thumbnail/gif creator
process.env.PATH = process.env.PATH + ':' + process.env['LAMBDA_TASK_ROOT']
const AWS = require('aws-sdk')
const { spawn, spawnSync } = require('child_process')
const { createReadStream, createWriteStream } = require('fs')
const { request } = require('http')
const s3 = new AWS.S3()
const ffprobePath = '/opt/nodejs/ffprobe'
const ffmpegPath = '/opt/nodejs/ffmpeg'
@benjaminadk
benjaminadk / lakers.js
Created June 25, 2019 03:18
lakers points production by player 2018-19
export default [
{
name: 'Kyle Kuzma',
points: 1308
},
{
name: 'Kentavious Caldwell-Pope',
points: 938
},
{
@benjaminadk
benjaminadk / javascript.json
Created August 23, 2019 02:33
styled component snippets
{
"react-import": {
"prefix": "ir",
"body": "import React from 'react'"
},
"styled-components import": {
"prefix": "st",
"body": ["import styled from 'styled-components'", "$1"]
},
"styled-components file template": {
@benjaminadk
benjaminadk / .bash_aliases
Last active August 27, 2019 23:57
my bash aliases
alias bashreload="source ~/.bashrc && echo Bash config reloaded" # reload bashrc
alias histg="history | grep" # seach history $1
alias mkdir="mkdir -pv" # make parent dirs as needed
alias q="exit" # quit
alias c='clear' # clear screen
alias h="history | grep" # search command history
alias p="cat" # print file
alias ~='cd ~' # home dir
alias cd..='cd ..' # back one dir
sources:
omv:
type: OMV
max_zoom: 10.5
min_display_zoom: 10.5
tiled: true
scene:
background:
color: global.land_color
@benjaminadk
benjaminadk / upsells.vba
Created January 4, 2020 17:48
Product upsell/crosssell/linking excel macro vba
Sub GenerateUpsellCSV()
'
' Macro1 Macro
'
' Find out how many rows are used and save as variable
lastrow = ActiveSheet.UsedRange.Rows.Count
' Insert formulas across the first row of data