CasperJSを動かすにはPhantomJSが必要なのでインストール。
- PhantomJS: Download and Install からzipをダウンロードして適当なところに置く。
- システムのプロパティとかからファイルを置いた場所のパス
;C:\phantomjs
(Cドラ直下の例)を環境変数PATH
に追記する。 - PCを再起動してコマンドプロンプトから
phantomjs --version
を叩いてバージョンが出ればインストール成功。
CasperJSを動かすにはPhantomJSが必要なのでインストール。
;C:\phantomjs
(Cドラ直下の例)を環境変数PATH
に追記する。phantomjs --version
を叩いてバージョンが出ればインストール成功。packages: | |
yum: | |
git: [] | |
files: | |
/opt/elasticbeanstalk/hooks/appdeploy/pre/51install_meteor.sh: | |
mode: "000755" | |
user: root | |
group: root | |
encoding: plain |
/* | |
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes. | |
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed | |
* | |
* Usage: | |
* $ casperjs screenshots.js http://example.com | |
*/ | |
var casper = require("casper").create(); |
#!/bin/sh | |
set -e | |
if [ $# -ne 2 -a $# -ne 3 ]; then | |
echo 'Usage:' | |
echo ' $ git export-diff <commit> <output_dir>' | |
echo ' $ git export-diff <commit> <commit> <output_dir>' | |
exit 1 | |
fi |
// Usage : less2stylusDir('../src/css/'); | |
var fs = require('fs'); | |
// this less 2 stylus conversion script make a stylus easy to read syntax | |
// - let the braces | |
// - replace the @ for var as $ | |
// - let semicolons | |
function less2stylus(less) |
@mixin boxit ($dir) { | |
display:box; | |
display:-moz-box; | |
display:-webkit-box; | |
box-orient:$dir; | |
-moz-box-orient:$dir; | |
-webkit-box-orient:$dir; | |
} | |
@mixin order ($num) { |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.