| 日時: | 2016-12-10 |
|---|---|
| 作: | @voluntas |
| バージョン: | 0.1.1 |
| url: | https://voluntas.github.io/ |
概要
| // serena から切り出したもの | |
| export interface SystemPromptParams { | |
| contextSystemPrompt: string; | |
| modeSystemPrompts: string[]; | |
| } | |
| export const systemPrompt = ({ | |
| contextSystemPrompt, | |
| modeSystemPrompts, |
| // for multiple requests | |
| let isRefreshing = false; | |
| let failedQueue = []; | |
| const processQueue = (error, token = null) => { | |
| failedQueue.forEach(prom => { | |
| if (error) { | |
| prom.reject(error); | |
| } else { | |
| prom.resolve(token); |
| import { Action, ActionReducer, Store } from '@ngrx/store'; | |
| import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
| import { Observable } from 'rxjs/Observable'; | |
| import { map } from 'rxjs/operator/map'; | |
| import { Observer } from 'rxjs/Observer'; | |
| // TODO: How to initialize those variables? | |
| const dispatcherMock: Observer<Action>, | |
| reducerMock: Observer<ActionReducer<any>>, | |
| stateMock: Observable<any>; |
| //Usage | |
| import React from 'react'; | |
| import { BrowserRouter as Router } from 'react-router-dom'; | |
| import Route from './AuthRoute'; | |
| import Login from './Login'; | |
| import Private from './Private'; | |
| export default () => | |
| <Router> |
| 日時: | 2016-12-10 |
|---|---|
| 作: | @voluntas |
| バージョン: | 0.1.1 |
| url: | https://voluntas.github.io/ |
概要
| #!/bin/sh | |
| source "$(git --exec-path)/git-sh-setup" | |
| # echo $GIT_DIR | |
| # echo $GIT_OBJECT_DIRECTORY | |
| EXPORT_FILENAME="diff-"`git rev-parse $1 | cut -b1-7`"-to-"`git rev-parse HEAD | cut -b1-7` | |
| if [[ $# == 1 ]]; then | |
| if [[ -n $(git rev-parse --verify --quiet $1) ]]; then |
Here's how I converted a whole batch of Stylus files to SASS without using a converter (none exist, that I'm aware of), converting each Stylus file manually, or programming my own Stylus->SASS converter, which would have entailed building a parser, and then generate SCSS from the AST.
First, grab sandr.py here: https://github.com/jfgiraud/sandr
Then, in the directory of your Stylus files, run (if you have multiple directory levels, you can do similar task using find):
for file in *.styl; do echo "/*! FILENAME: $file */" >tempfile; cat $file >>tempfile; mv tempfile $file; done
| var React = require('react'); | |
| var cx = require('classnames'); | |
| var vjs = require('video.js'); | |
| var _forEach = require('lodash/collection/forEach'); | |
| var _debounce = require('lodash/function/debounce'); | |
| var _defaults = require('lodash/object/defaults'); | |
| var DEFAULT_HEIGHT = 800; | |
| var DEFAULT_WIDTH = 600; | |
| var DEFAULT_ASPECT_RATIO = (9 / 16); |
| // Create or open an existing Sheet and click Tools > Script editor and enter the code below | |
| // 1. Enter sheet name where data is to be written below | |
| var SHEET_NAME = "Sheet1"; | |
| // 2. Run > setup | |
| // 3. Publish > Deploy as web app | |
| // - enter Project Version name and click 'Save New Version' | |
| // - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously) | |
| // 4. Copy the 'Current web app URL' and post this in your form/script action | |
| // 5. Insert column names on your destination sheet matching the parameter names of the data you are passing in (exactly matching case) |