Skip to content

Instantly share code, notes, and snippets.

@konitter
konitter / casperjs-on-win.md
Last active December 17, 2015 14:38
CasperJS on Windows

CasperJS on Windows

PhantomJS installation

CasperJSを動かすにはPhantomJSが必要なのでインストール。

  1. PhantomJS: Download and Install からzipをダウンロードして適当なところに置く。
  2. システムのプロパティとかからファイルを置いた場所のパス;C:\phantomjs(Cドラ直下の例)を環境変数PATHに追記する。
  3. PCを再起動してコマンドプロンプトからphantomjs --versionを叩いてバージョンが出ればインストール成功。
@fightingtheboss
fightingtheboss / configuration.yml
Last active September 15, 2023 07:29
An Amazon Elastic Beanstalk configuration file for a Meteor project. This file needs to be saved in the .ebconfiguration/ directory at the root of your project. Deployed with `git aws.push`. Replace MONGO_URL with the URL to your MongoDB instance (I use MongoHQ).
packages:
yum:
git: []
files:
/opt/elasticbeanstalk/hooks/appdeploy/pre/51install_meteor.sh:
mode: "000755"
user: root
group: root
encoding: plain
@nhoizey
nhoizey / screenshots.js
Created November 12, 2012 17:07
Take screenshots at different viewport sizes using CasperJS
/*
* 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();
@hokaccha
hokaccha / git-export-diff
Created September 22, 2012 02:14
gitの差分のファイルをつくる
#!/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
@MoOx
MoOx / less2stylus.js
Created August 27, 2012 17:37 — forked from lancejpollard/less2stylus.coffee
Convert LESS to Stylus
// 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)
@irishstu
irishstu / gist:2718782
Created May 17, 2012 13:06
Boxorder mixin
@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) {
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

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.

Twitter