This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const makeRuby=([bottom,top])=>`<ruby>${bottom}<rp>(</rp><rt>${top}</rt><rp>)</rp></ruby>` | |
| const ruby = (text,...rest)=>{let output='';for(let i=0;i<text.length+rest.length;i++){output=output+(i%2==0?text[i/2]:makeRuby(rest[(i/2)-.5]))}return output} | |
| // use like: ruby`今日は${['木曜日','もくようび']}です` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env /usr/local/bin/node | |
| // run like: node nquik path/to/directory | |
| const { exec } = require('child_process'); | |
| exec('npx simple-server '+process.argv[2]+' 8080') | |
| exec('~/ngrok http 8080') | |
| exec('open http://127.0.0.1:4040') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env /usr/local/bin/deno run | |
| const separator = Symbol('separator'); | |
| const darkMode = true; //process.env.BitBarDarkMode === '1'; | |
| bitbar([ | |
| { | |
| text: '❤', | |
| //color: bitbar.darkMode ? 'white' : 'red', | |
| dropdown: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var makerjs = require('makerjs'); | |
| var o=makerjs.model.combineUnion( | |
| {paths:{circle:new makerjs.paths.Circle([0, 0], 78/2)}}, | |
| {models:{ | |
| rect:new makerjs.models.RoundRectangle(4,14,1) | |
| }, | |
| origin:[-(78/2)-2,-7] | |
| } | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ui.hide_hpto=true | |
| audio.play_bitrate_enumeration=4 | |
| audio.episode.speed=150 | |
| ui.show_unplayable_tracks=true | |
| app.browser.zoom-level=-100 | |
| ui.show_friend_feed=false | |
| audio.sync_bitrate_enumeration=4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function shuffle(){ | |
| osascript -l JavaScript<<'END' | |
| const spotify = Application('spotify') | |
| if(spotify.running()){ | |
| try{ | |
| spotify.shuffling = !spotify.shuffling() | |
| } | |
| catch(e){''} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AnimatedSync extends Component { | |
| state={spinValue:new Animated.Value(0)} | |
| constructor(props){ | |
| super(props); | |
| console.log('AnimatedSync :::', props, this.state) | |
| this.animate() | |
| } | |
| animate=()=>( | |
| this.state.spinValue.setValue(0), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| const CountStateContext = React.createContext() | |
| const CountDispatchContext = React.createContext() | |
| function countReducer(state, action) { | |
| switch (action.type) { | |
| case 'increment': { | |
| return {count: state.count + 1} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "a!" | |
| dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd ) | |
| audio="$dir/playlist" | |
| # for now just plays first track found in playlist | |
| file=$(find $audio -name "*.wav" | head -n 1) | |
| afplay "$file" | |
| echo "$file" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var makerjs = require('makerjs'); | |
| var points = [ | |
| [0,0], | |
| [45,-55], | |
| [80,-220], | |
| [0,-180] | |
| ] | |
| var model = new makerjs.models.ConnectTheDots(true, points); |