Skip to content

Instantly share code, notes, and snippets.

View pjambet's full-sized avatar

Pierre Jambet pjambet

View GitHub Profile
var getAllObjects = function(className, options) {
var batchSize = 100;
var grandResult = [];
var offset = 0;
var getNextBatch = function(objects) {
if (objects) {
grandResult = grandResult.concat(objects);
}
if (objects === null || objects.length === batchSize) {
var query = new Parse.Query(className);
Wed Sep 17 15:09:16 2014 Natalie Weizenbaum <nweiz@google.com>
* ext/pathname/lib/pathname.rb (SAME_PATHS):
Pathname#relative_path_from uses String#casecmp to compare strings
on case-insensitive filesystem platforms (e.g., Windows). This can
return nil for strings with different encodings, and the code
previously assumed that it always returned a Fixnum. [Fix GH-713]
Wed Sep 17 15:07:35 2014 Sho Hashimoto <sho.hsmt@gmail.com>
@pjambet
pjambet / keybase.md
Created February 23, 2015 17:13
keybase.md

Keybase proof

I hereby claim:

  • I am pjambet on github.
  • I am pierrej (https://keybase.io/pierrej) on keybase.
  • I have a public key whose fingerprint is D971 2AA5 0673 BD0A 5BA9 EB09 ABCE CFD5 45D1 7EA0

To claim this, I am signing this object:

"💩".gsub(/([\u{2600}-\u{26FF}]|[\u{1F000}-\u{1F8FF}]|[\u{2300}-\u{23FF}])/, "")
ref:
http://stackoverflow.com/questions/24672834/how-do-i-remove-emoji-from-string/24673322#24673322
http://en.wikipedia.org/wiki/Unicode_block
# option A
list = [1,2,3,4]
list2 = [
1,
2,
3,
4,
]

Keybase proof

I hereby claim:

  • I am pjambet on github.
  • I am pierrej (https://keybase.io/pierrej) on keybase.
  • I have a public key whose fingerprint is A7A2 1A00 1B8E BF41 1E54 7574 8DEF 6131 386B D257

To claim this, I am signing this object:

@pjambet
pjambet / .vimrc
Last active December 13, 2015 22:25
let g:gist_post_private = 1
@pjambet
pjambet / atomic.rb
Last active July 19, 2023 21:38
Companion code for atomic operations in sql
require 'minitest/autorun'
require 'pg'
require 'mysql2'
require 'sequel'
def get_db(database_name)
case database_name
when :pg
Sequel.connect('postgres://pierre:@localhost:5432/pierre')
when :mysql
export CPPFLAGS="-I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include"
export LDFLAGS="-L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -Wl,-dead_strip_dylibs"
POSTGRES_EXTRA_CONFIGURE_OPTIONS="--with-uuid=e2fs --with-bonjour --with-openssl -v" asdf install postgres 9.6.10
<p class="subtitle">Learn how one of the web&#8217;s biggest accidental success stories evolved.</p></header></div></div><div class="site-inner"><div class="content-sidebar-wrap"><main class="content"><article class="post-9674 page type-page status-publish entry"><div class="saboxplugin-wrap"><div class="saboxplugin-gravatar"><picture width="100" height="100" alt="Claire Broadley" class="avatar avatar-100 wp-user-avatar wp-user-avatar-100 alignnone photo sp-no-webp"><source srcset="https://digital.com/wp-content/uploads/AAEAAQAAAAAAAAkMAAAAJDIwMTM5ZDdiLTQwNTMtNDMxZS1iOGJlLWZlOGI1NzlhYzFlNg-150x150.webp" type="image/webp"><source srcset="https://digital.com/wp-content/uploads/AAEAAQAAAAAAAAkMAAAAJDIwMTM5ZDdiLTQwNTMtNDMxZS1iOGJlLWZlOGI1NzlhYzFlNg-150x150.jpg"><img src="https://digital.com/wp-content/uploads/AAEAAQAAAAAAAAkMAAAAJDIwMTM5ZDdiLTQwNTMtNDMxZS1iOGJlLWZlOGI1NzlhYzFlNg-150x150.jpg" width="100" height="100" alt="Claire Broadley" class="avatar avatar-100 wp-user-avatar wp-user-avatar-100 alignnone photo s