# Incorporate this function into your .bash_profile (.bashrc, .zshrc, or whatever you use...) | |
# Run `mov2frames name-of-mov.mov` to extract frames from the movie file | |
# Run `mov2frames name-of-mov.mov 300` to extract frames from the movie file at a maximum width of 300 pixels | |
# Frames will be exported into a `frames/` folder | |
# NOTE: if the frames folder exists and contains files that match the filename `frame_%03d.png`, no frames will be generated | |
mov2frames() { | |
if [ ! -z "$2" ] | |
then | |
size=$2 | |
else |
/*<?php | |
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s", | |
//\u000A\u002F\u002A | |
class PhpJava { | |
static function main() { | |
echo(//\u000A\u002A\u002F | |
"Hello World!"); | |
}} | |
//\u000A\u002F\u002A | |
PhpJava::main(); |
if os.Getenv("GODEBUG") != "cgocheck=0" { | |
cmd := exec.Command(os.Args[0], os.Args[1:]...) | |
env := os.Environ() | |
env = append(env, "GODEBUG=cgocheck=0") | |
cmd.Env = env | |
cmd.Stdin = os.Stdin | |
cmd.Stdout = os.Stdout | |
cmd.Stderr = os.Stderr | |
err := cmd.Run() | |
fmt.Println(err) |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
A maintainable application architecture requires that the UI only contain the rendering logic and execute queries and mutations against the underlying data model on the server. A maintainable architecture must not contain any logic for composing "app state" on the client as that would necessarily embed business logic in the client. App state should be persisted to the database and the client projection of it should be composed in the mid tier, and refreshed as mutations occur on the server (and after network interruption) for a highly interactive, realtime UX.
With GraphQL we are able to define an easy-to-change application-level data schema on the server that captures the types and relationships in our data, and wiring it to data sources via resolvers that leverage our db's own query language (or data-oriented, uniform service APIs) to resolve client-specified "queries" and "mutations" against the schema.
We use GraphQL to dyn
// adapted from https://tonicdev.com/n3dst4/twelve-days-of-emoji | |
// full credit to n3dst4. I just rewrote this to be browser developer tools friendly. | |
const pressies = [ | |
"🐦🍐🌳", | |
"🐢🐦", | |
"🇫🇷🐔", | |
"📞🐦", | |
"💛💍", | |
"🐦🍳 ", | |
"🐦🏊", |
val s3Paths = "s3://yourbucket/path/to/file1.txt,s3://yourbucket/path/to/directory" | |
val pageLength = 100 | |
val key = "YOURKEY" | |
val secret = "YOUR_SECRET" | |
import com.amazonaws.services.s3._, model._ | |
import com.amazonaws.auth.BasicAWSCredentials | |
import com.amazonaws.services.s3.model.ObjectListing | |
import scala.collection.JavaConverters._ | |
import scala.io.Source |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
Answering the Front-end developer JavaScript interview questions to the best of my ability.
- Explain event delegation
Sometimes you need to delegate events to things.
- Explain how
this
works in JavaScript
This references the object or "thing" defined elsewhere. It's like "hey, thing I defined elsewhere, I'm talkin' to you."
- Explain how prototypal inheritance works.