Skip to content

Instantly share code, notes, and snippets.

View djee's full-sized avatar

Jean-François Dumas djee

  • Mountain View, California
  • 09:27 (UTC -07:00)
View GitHub Profile
@jmlagace
jmlagace / to_ruby_hash.php
Last active December 29, 2020 21:23 — forked from yoshitsugu/to_ruby_hash.php
PHPのArrayをRubyのHashに変換。PHP Array to Ruby Hash
function to_ruby_hash($array){
$result = "{";
foreach($array as $key => $value){
$result .= "\"".$key."\" => ";
if(is_array($value) || is_object($value)){
$result .= to_ruby_hash($value).",\n";
}else{
$result .= "\"".$value."\",";
}
}
@subfuzion
subfuzion / curl.md
Last active April 19, 2025 09:46
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@toshimaru
toshimaru / jquery-scroll-bottom.js
Last active July 21, 2024 00:02
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
@xdite
xdite / gist:3072362
Created July 8, 2012 19:10
deploy/asset.rb
# -*- encoding : utf-8 -*-
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb)
namespace :deploy do
namespace :assets do
desc <<-DESC
Run the asset precompilation rake task. You can specify the full path \
to the rake executable by setting the rake variable. You can also \