Skip to content

Instantly share code, notes, and snippets.

View OriPekelman's full-sized avatar

Ori Pekelman OriPekelman

View GitHub Profile
{"completion_percent":100,"log":"EnvironmentBranchActivity#tqh5yaygio4ls: Executing activity\nCreating branch refs/heads/plip from branch refs/heads/plop\nBuilding application 'app' (runtime type: php:7.0, tree: 01c62a6)\n Slug already built for this tree id, skipping.\n\nCreating environment marbybgp54ie6-plip-mff2xhi.\n Environment configuration:\n app (type: php:7.0, size: S, disk: 2048)\n mysqldb (type: mysql:10.0, size: S, disk: 2048)\n\n Environment routes:\n http://plip-mff2xhi-marbybgp54ie6.eu.platform.sh/ is served by application `app`\n https://plip-mff2xhi-marbybgp54ie6.eu.platform.sh/ is served by application `app`\n\n","parameters":{"environment":"plip","user":"384491da-031e-4c23-b264-9f96040a6e36","parent":"plop"},"created_at":"2016-10-24T19:11:15.172871+00:00","updated_at":"2016-10-24T19:11:51.028092+00:00","environments":["plop","plip"],"payload":{"outcome":{"status":"inactive","head_commit":null,"machine_name":"plip-mff2xhi","name":"plip","parent":"plop","title":"plip","created
require "rubygems"
require 'rmeetup'
client= RMeetup::Client.new({api_key: "getyourown"})
results = client.fetch(:rsvps,{event_id: 229384168, urlname: "Paris-Datageeks"})
members = results.select{|result|result.rsvp["response"]=="yes"}.map { |result| {name: result.rsvp["member"]["name"], image: result.rsvp["member_photo"].nil? ? "" : result.rsvp["member_photo"]["thumb_link"]}}
puts members.inspect
@OriPekelman
OriPekelman / reset_platformsh_project.sh
Created February 4, 2016 10:12
Jenkins Job To reset a platform project (used for demos)
# You should export the following variables:
# $API_TOKEN which you get from marketplace
# $PROJECT_ID the platform project like 'hzdp3vdw4poyg'
# $ENVIRONMENT for example 'master'
# $BACKUP_ID which you can get from the CLI
COMPOSER=$(command -v composer >/dev/null 2>&1) || true
if [ -z "$COMPOSER" ] && [ ! -f .build/composer.phar ]; then
mkdir -p .build
curl -sS https://getcomposer.org/composer.phar > .build/composer.phar
@OriPekelman
OriPekelman / Gemfile
Last active December 19, 2015 18:49
The HTTP gem failing urls
source 'https://rubygems.org'
gem 'http', :path =>'/Users/oripekelman/Sites/http'
gem 'sinatra'
@OriPekelman
OriPekelman / slugify.py
Last active October 10, 2015 17:35
domain compatible slugifcation
#!/usr/bin/python
# coding=UTF-8
import re
import unicodedata
import string
import random
first_cap_re = re.compile('(.)([A-Z][a-z]+)')
all_cap_re = re.compile('([a-z0-9])([A-Z])')
def slugify(value):
"""
@OriPekelman
OriPekelman / ori-rulu
Created June 23, 2012 12:46
My #rulu presentation, what did Tony Arcieri did lately?
data:text/html;charset=utf-8,%3C%21doctype%20html%3E%3Chtml%20lang%3D%22en%22%3E%3Chead%3E%20%3Cmeta%20charset%3D%22utf-8%22%20/%3E%20%20%20%20%3Cmeta%20name%3D%22viewport%22%20content%3D%22width%3D1024%22%20/%3E%20%20%20%20%3Cmeta%20name%3D%22apple-mobile-web-app-capable%22%20content%3D%22yes%22%20/%3E%20%20%20%20%3Ctitle%3EDeck%20Title%3C/title%3E%20%20%20%20%20%20%20%20%3Cmeta%20name%3D%22description%22%20content%3D%22TODO%22%20/%3E%20%20%20%20%3Cmeta%20name%3D%22author%22%20content%3D%22TODO%22%20/%3E%20%20%20%20%3Cstyle%3E%20%20%20%20.componentContainer%20%7B%20%20%20%20%20%20%20%20position%3A%20absolute%3B%20%20%20%20%20%20%20%20-webkit-transform-origin%3A%200%200%3B%20%20%20%20%20%20%20%20-moz-transform-origin%3A%200%200%3B%20%20%20%20%20%20%20%20transform-origin%3A%200%200%3B%20%20%20%20%7D%20%20%20%20%3C/style%3E%20%20%20%20%3Clink%20href%3D%22http%3A//tantaman.github.com/Strut/client/web/preview_export/css/main.css%22%20rel%3D%22stylesheet%22%20/%3E%20%20%20%20%20%20%20%20%3Clink%20rel%3D%22shortcut
@OriPekelman
OriPekelman / Gemfile
Created April 4, 2012 17:48
Minimal File Indexer Elastic Search Example (ruby)
source :rubygems
gem 'tire'
gem 'sinatra'
@OriPekelman
OriPekelman / dlq.js
Created May 31, 2015 12:07
quantized Damreau Lehvenstein in Javascript
(function() {
'use strict';
/**
* Extend an Object with another Object's properties.
*
* The source objects are specified as additional arguments.
*
* @param dst Object the object to extend.
*
@OriPekelman
OriPekelman / sphinx_to_gitbook.py
Created May 26, 2015 15:43
Recursively creates an md file for all rst files in the source t directory and below.
#!/usr/bin/env python
'''
Recursively creates an md file for all rst
files in the source directory and below.
'''
import sys, os, re, subprocess
target = 'gitbook/'
source = './'
<?php
$path = parse_url($_SERVER['REQUEST_URI']);
$path = rtrim(ltrim(rtrim($path["path"], '/'), '.'),'/'); //trim trailing slash and prefix dots
$index = realpath(getcwd() .$path ."/index.html");
if (substr($index, 0, strlen(realpath(getcwd()))) === realpath(getcwd()) && file_exists($index)){
try {
readfile($index);
exit;
} catch (Exception $e) {
/*Eating all exceptions*/