Skip to content

Instantly share code, notes, and snippets.

View niaeashes's full-sized avatar

Nia niaeashes

  • Fukuoka
  • 08:20 (UTC +09:00)
View GitHub Profile
@danharper
danharper / gulpfile.js
Last active April 11, 2024 08:31
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
anonymous
anonymous / gulpfile.js
Created May 8, 2014 16:17
var gulp = require('gulp');
var sass = require('gulp-sass');
var prefix = require('gulp-autoprefixer');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var nodemon = require('gulp-nodemon');
gulp.task('sass', function () {
gulp.src('scss/*.scss')
.pipe(sass({outputStyle: 'compressed'}, {errLogToConsole: true}))
@mikeraimondi
mikeraimondi / database_cleaner.rb
Created June 29, 2013 00:25
database_cleaner config for Capybara/RSpec with poltergeist
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = Capybara.current_driver == :rack_test ? :transaction : :truncation
DatabaseCleaner.clean
DatabaseCleaner.start
end
@mala
mala / gist:5108900
Created March 7, 2013 15:38
攻撃者が生パスワードまず復元できないだろという状況でも全ユーザーのパスワードリセットしたほうが良い10の理由

Evernoteの話ですけど。「強固なパスワード暗号化技術を採用」していて、攻撃者がまず生パスワード復元できないだろう、という状況であっても、パスワードリセットはしたほうがいい。

2011年のLastpassのケースでは、強固なパスワード使っている人は大丈夫だけど、そうじゃない場合はブルートフォースでマスターパスワード取得されうるということを発表していた。これはハッシュ値生成のアルゴリズムが、既知 or 推測しやすい or ソースコードも含めて漏洩している、という時にこの状態になる。

"If you have a strong, non-dictionary based password or pass phrase, this shouldn't impact you - the potential threat here is brute forcing your master password using dictionary words, then going to LastPass with that password to get your data. Unfortunately not everyone picks a master password that's immune to brute forcing."

で、Evernoteのケースは「弊社は強固なパスワード暗号化技術を採用しておりますが」と言っている。

@hayajo
hayajo / changelog_en.md
Last active July 19, 2024 05:47
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@Darksecond
Darksecond / nginx.conf
Created October 8, 2012 20:24
Systemd + Unicorn + Nginx + no-downtime-reload
# The only setting we feel strongly about is the fail_timeout=0
# directive in the "upstream" block. max_fails=0 also has the same
# effect as fail_timeout=0 for current versions of nginx and may be
# used in its place.
# you generally only need one nginx worker unless you're serving
# large amounts of static files which require blocking disk reads
worker_processes 1;
# # drop privileges, root is needed on most systems for binding to port 80
@tbranyen
tbranyen / backbone_pushstate_router.js
Last active February 25, 2024 21:38
hijack links for pushState in Backbone
// All navigation that is relative should be passed through the navigate
// method, to be processed by the router. If the link has a `data-bypass`
// attribute, bypass the delegation completely.
$(document).on("click", "a[href]:not([data-bypass])", function(evt) {
// Get the absolute anchor href.
var href = { prop: $(this).prop("href"), attr: $(this).attr("href") };
// Get the absolute root.
var root = location.protocol + "//" + location.host + Application.root;
// Ensure the root is part of the anchor href, meaning it's relative.