memo
slimでwrap_layout使おうとしてエラーった。- を = に。 wrap_layout doesn't work with slim 参考: wrap_layout doesn't work with slim on ~> 3.3.2 #1269
メモ。 //gulpfile.js require('coffee-script/register'); require('./gulpfile.coffee'); //gulpfile.coffee gulp = require('gulp') gulp.task 'default', () -> console.log('gulp!') 参考。 http://efcl.info/2014/0123/res3625/ http://safx-dev.blogs…
node-webkitで作ったアプリで、データロード処理と保存処理部分をそれぞれ書き換えてみた。 PromiseのライブラリはBluebirdを使ってみた。 あと、cheerioをDOMのパースに使用。 FTPは、jsftpを使用。 データロード処理の流れ(load) 1. FTPでデータ取得 2. FT…
node-webkitのJavaScript Contextでのrequireでのパス解決でハマる場合がある。 例えばこんなファイル構成で index.html js index.js(index.ts) fileUploader.js 各ファイルがこんな感じ。 <html> <head > <meta charset="utf-8" /> ................. <script src="js/index.js"></script> </body> </html> //js/index.js ........…
こういうの。 ///<reference path='./typing/node.d.ts' /> ///<reference path='./typing/jsftp.d.ts' /> import JSFtp = require('jsftp'); .......................... var Ftp = new JSFtp({ host: connect.host, port: connect.port, user: connect.account, pass: connect.password }); .......................... jsftp用に…</reference></reference>
メニュー出したりとかデスクトップアプリ特有のネイティブのアレをNode側から使いたい。 1.require時に引数として渡す //index.js var gui = require('nw.gui'); //↓コレ var fileUploader = require('fileUploader')(gui); 例なので全部渡しちゃってるけど…
メモ Gruntfile.coffee ...................................... slim: pretty: options: pretty: true files: [ expand: true cwd: 'src' src: ['{,*/}*.slim'] dest: 'app' ext: '.html' ] ...................................... grunt.loadNpmTasks('gr…
.bowerrcに記述 { "directory": "app/bower_components" }
node-webkitで作成したアプリのパッケージングはappディレクトリを対象として実行してて、npmをcd app してからnpm i --productionと手動で処理していたので、Gruntに登録した。 Gruntfile.coffeeの該当箇所 ...... exec: npm_i_production: cwd: 'app' cmd:…
Icons に書いてある。 Resource Hackerで書き換える。 これだとWindowsのパッケージングが自動化出来ないのでアレ。
grunt-node-webkit-builder使う。 使う人の環境がWindowsだけど、一応Macも作っとく。 Gruntfile.coffeeはこんな感じ。appディレクトリに集めたファイルをパッケージング。 module.exports = (grunt) -> pkg = grunt.file.readJSON 'package.json' .........…
node-webkitでアプリを開発していて、node-webkitの環境ならでは?の問題にはまったのでメモ。 前提 % bower install eonasdan-bootstrap-datetimepicker --save nodeのcontextではなくJavaScriptのcontextでの話。 アプリでbootstrap 3対応のdatetimepicker…
WebStorm 8.0.1以上、package.json等作成済みとして話を進める。 メニューのRunからEdit Configurations…を選択 node-webkitを追加 アプリの場所を指定。グローバルに入れたnode-webkitではなく、npmでプロジェクト下に入れたnode-webkitを指定する場合はint…
npmでglobalにインストールしたtypescriptとbowerを削除。 % npm uninstall -g bower % npm uninstall -g typescript npmを削除 % npm uninstall -g npm Node.jsを削除 brew uninstall node nodebrewをインストール % curl -L git.io/nodebrew | perl - setu…
さくらのVPSで運用していたkatahirado.jp(VALUE DOMAINで取得)を、WebサイトはAmazon S3に、メールはGoogle Apps for Businessにそれぞれ移行しました。 Webサイト、メールサーバの他に、redmine、git、Railsのデモアプリが動いていましたが、 git,redmineは…
11/20日追記:SafariとChromeでも試して見たところ、JSでbodyに複数appendChildすると順番は一定しない事を確認。そうだったのか。 http://blog.setunai.net/20120317/javascript%E3%81%AE%E5%AE%9F%E8%A1%8C%E9%A0%86%E5%BA%8F%E3%81%AB%E3%81%A4%E3%81%84%E…
一つ前のエントリーでは端折っていたが、ファイルのアイコンを取得するのが目的で、pathをあれこれやってあれってなったのであんなエントリーを残した。せっかくなのでアイコン取得もメモ。 pathをStringでアイコン取得する場合。 //_fullPath はこんなのが…
やっちゃ駄目って書いてあるからやるほうが悪いんですが・・ stringByAppendingPathComponent:のリファレンスには下記のように書いてあります。 Note that this method only works with file paths (not, for example, string representations of URLs). fil…
NSAnimatablePropertyContainer プロトコルのanimatorを使えば下記のような感じに書ける↓ https://developer.apple.com/library/mac/#samplecode/BasicCocoaAnimations/Listings/MainWindowController_m.html しかしWebViewでanimatorメソッドを使ってみたら…
http://stacktrace.jp/jquery/with_other_lib.html#other_version noConflictの引数にtrue渡せばいいと。 <html> <head> <script type="text/javascript" src="jquery-1.2.6.js"></script> <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript"> // $ 関数および jQuery関数の上書きを元に戻します。 var $j =…</head></html>
忘れるので。http://blog.natsuapps.com/2011/11/ios5-arc-autorelease-bridge-xcode.html
一つ前のエントリーとは逆に、Objective-CのオブジェクトをJSONへ、のパターン。 素直なNSArrayとかNSDictionaryを処理する場合には特に注意する点はなし*1。 SQLiteがストアのCoreDataで,FetchしたResultのNSArrayをJSONとして渡したい場合等は注意が必要。…
複雑な構造のはJSON使って渡せばよかったんじゃないかorz WebViewのJavaScriptとObjective-Cでのやり取りでもそりゃJSON使えるか。 JSON使うのはWebのAPI叩くときみたいな固定観念が。頭固い。 OS X 10.7から標準でNSJSONSerializationが使える。iOSは5から…
11/7追記:WebKit DOM Programming TopicsのCalling Objective-C Methods From JavaScriptに書いてあった。WebKit側の資料しか見てなかったから気づかなかったorz Other JavaScript objects are wrapped as WebScriptObject instances. As an exception, Java…
11/7追記:WebKit DOM Programming TopicsのCalling Objective-C Methods From JavaScriptに書いてあった。WebKit側の資料しか見てなかったから気づかなかったorz Other JavaScript objects are wrapped as WebScriptObject instances. As an exception, Java…
OS Xの。 UIWebViewは別。 "WebKitDeveloperExtras"と。 http://qiita.com/items/7c737f8f135199cc82b1 調べたついで。iOSのUIWebViewをOS XのSafariのWeb Inspector使ってリモートデバッグ http://j-apps.sakura.ne.jp/prototype/2011/12/10/uiwebview%E3%8…
WebScripting Protocol Reference の webScriptNameForSelector: に書いてあった。 It is your responsibility to ensure that the returned name is unique to the script invoking this method. If this method returns nil or you do not implement it, t…
メモ。 http://www.tohoho-web.com/html/iframe.htm http://hyper-text.org/archives/2012/05/iframe_seamless_attribute.shtml
XPathなやつ。Macアプリだと、NSXMLDocumentがあるから不要かな。iPhoneiOSだと、NSXMLDocument使えないのですね。 http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html libxmlのHTMLParserをObjective-Cでラップしたライブラリ。AR…
"interface for an HTML 4.0 non-verifying parser"ってどどんと書いてあるので自明ではあるのですが。 http://xmlsoft.org/html/libxml-HTMLparser.html うーん https://bugzilla.gnome.org/show_bug.cgi?id=655218 HTMLのパースをしたくて色々調べたのです…