Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jeremymarc on github.
  • I am jeremymarc (https://keybase.io/jeremymarc) on keybase.
  • I have a public key ASACGUNm_rZSIHqXVy9R5BL7qhxv1FPbcVyK7mtktPFsjQo

To claim this, I am signing this object:

@jeremymarc
jeremymarc / google_play_receipt_verification.md
Created March 29, 2017 16:41 — forked from derrek/google_play_receipt_verification.md
Google Play/Android Receipt Validation/Verification/Lookup with Ruby

This document outlines setting up google's ruby gem, google-api-client, to verify payloads(receipts) sent to a server from google play in app purchases made via an android app.
This document was written using version 0.9.13.

First you'll need 'owner' access to the google play developer's console that contains the mobile app you wish to verify receipts from.

  • Go to https://play.google.com/apps/publish
  • Click on the mobile app you'd like to set up
  • Click "Settings" on the left click "API access"
  • Below "LINKED PROJECT" link the google play account

Next setup an api account

<script type="text/javascript">
window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o||e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,e,n){function r(t){try{s.console&&console.log(t)}catch(e){}}var o,i=t("ee"),a=t(15),s={};try{o=localStorage.getItem("__nr_flags").split(","),console&&"function"==typeof console.log&&(s.console=!0,o.indexOf("dev")!==-1&&(s.dev=!0),o.indexOf("nr_dev")!==-1&&(s.nrDev=!0))}catch(c){}s.nrDev&&i.on("internal-error",function(t){r(t.stack)}),s.dev&&i.on("fn-err",function(t,e,n){r(n.stack)}),s.dev&&(r("NR AGENT IN DEVELOPMENT MODE"),r("flags: "+a(s,function(t,e){return t}).join(", ")))},{}],2:[function(t,e,n){function r(t,e,n,r,o){try{d?d-=1:i("err",[o||new UncaughtException(t,e,n)])}catch(s){try{i("ierr",[s,(new Date).getTime(),!0])}catch(c){}}return"function"==typeof f&&f.
@jeremymarc
jeremymarc / capybara cheat sheet
Last active August 29, 2015 14:25 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')

Autres

909C

  • Data Analyst
Data Scientist
  • Database Architect (GraphDB)

Ametix

  • QA manager
  • Analyste d’exploitation/gestionnaire d’incidents
# Depends on gems eventmachine, em-http-request,
# and em-resolv-replace (for # async DNS)
require 'eventmachine'
require 'em-http'
require 'fiber'
require 'em-resolv-replace'
def make_request_to(url)
connection = EventMachine::HttpRequest.new(url)
class Api::RegistrationsController < Api::BaseController
respond_to :json
def create
user = User.new(params[:user])
if user.save
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201
return
else
<?php
namespace Dpn\ToolsBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Dpn\ToolsBundle\Form\DataTransformer\EntityToIdTransformer;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\Common\Persistence\ObjectManager;
--
-- Name: c_posts_voted(); Type: FUNCTION; Schema: public; Owner: -
--
CREATE FUNCTION c_posts_voted() RETURNS trigger
LANGUAGE plpgsql
AS $$ BEGIN
UPDATE "posts" SET voted_user_ids = array_append(voted_user_ids, NEW.user_id) WHERE "id" = NEW.post_id;
RETURN NEW;
END;
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Styling radios &amp; checkboxes using CSS3</title>
<link rel="stylesheet" media="screen" href="styles.css" >
</head>
<body>
<h1>Styling radios &amp; checkboxes using CSS3</h1>