This file contains 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
;; forked from https://gist.github.com/ustun/73321bfcb01a8657e5b8 | |
(defun eslint-fix-file () | |
(interactive) | |
(call-process-shell-command | |
(concat "eslint --fix " (buffer-file-name)) nil 0)) | |
(defun eslint-fix-file-and-revert () | |
(interactive) | |
(eslint-fix-file) |
This file contains 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
module Mongoid | |
class Criteria | |
def each_by(by, &block) | |
idx = 0 | |
total = 0 | |
set_limit = options[:limit] | |
while ((results = ordered_clone.limit(by).skip(idx)) && results.any?) | |
results.each do |result| | |
return self if set_limit and set_limit >= total |
This file contains 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/sh | |
git clone git://github.com/masainox/wordpress-heroku.git -b language-ja | |
cd wordpress-heroku | |
heroku create -b git://github.com/iphoting/heroku-buildpack-php-tyler.git | |
heroku addons:add heroku-postgresql:dev | |
heroku pg:promote `heroku config | grep 'HEROKU_POSTGRESQL_' | sed -e "s/\:.*//"` |
This file contains 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
@mixin box-shadow($top, $left, $blur, $color, $inset: false) { | |
@if $inset { | |
-webkit-box-shadow:inset $top $left $blur $color; | |
-moz-box-shadow:inset $top $left $blur $color; | |
box-shadow:inset $top $left $blur $color; | |
} @else { | |
-webkit-box-shadow: $top $left $blur $color; | |
-moz-box-shadow: $top $left $blur $color; | |
box-shadow: $top $left $blur $color; | |
} |
This file contains 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
function uuid() { | |
var uuid = "", i, random; | |
for (i = 0; i < 32; i++) { | |
random = Math.random() * 16 | 0; | |
if (i == 8 || i == 12 || i == 16 || i == 20) { | |
uuid += "-" | |
} | |
uuid += (i == 12 ? 4 : (i == 16 ? (random & 3 | 8) : random)).toString(16); | |
} |