Skip to content

Instantly share code, notes, and snippets.

View iddqd3's full-sized avatar

Vladimir iddqd3

  • Extreme Developers
  • Russia
View GitHub Profile
@menny
menny / verify_appstore_in_app.php
Last active February 15, 2024 14:45
How to verify in-app purchases from AppStore and Market in PHP code (server-side)
function verify_app_store_in_app($receipt, $is_sandbox)
{
//$sandbox should be TRUE if you want to test against itunes sandbox servers
if ($is_sandbox)
$verify_host = "ssl://sandbox.itunes.apple.com";
else
$verify_host = "ssl://buy.itunes.apple.com";
$json='{"receipt-data" : "'.$receipt.'" }';
//opening socket to itunes
@jdkanani
jdkanani / notepad.html
Last active June 16, 2024 13:44 — forked from jakeonrails/Ruby Notepad Bookmarklet
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
function ValidateGooglePlaySignature( $responseData, $signature, $publicKey, &$status, &$response )
{
$responseData = trim( $responseData );
$signature = trim( $signature );
$response = json_decode( $responseData );
// Create an RSA key compatible with openssl_verify from our Google Play sig
$key = "-----BEGIN PUBLIC KEY-----\n".
chunk_split($publicKey, 64,"\n").
'-----END PUBLIC KEY-----';
@hogart
hogart / index.js
Created November 4, 2014 05:18
django-like settings for node projects
'use strict';
var env = process.env.NODE_ENV || 'development'; // development by default
var config = {};
try {
config = require('./local'); // local.js has priority
} catch (e) {
config = require('./' + env); // if local.js is not present, get config with environment name
}
@kallisti5
kallisti5 / gist:01f6df3bfb77b978abfe
Created December 31, 2014 14:31
Upgrade DO Fedora 20 to Fedora 21
#!/bin/bash
# Digital Ocean Fedora 20 -> 21 upgrade script
# 2014, Alexander von Gluck IV
# Author not responsible for data loss. Ensure you have valid
# backups before using this script!
yum update
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-21-$(uname -i)
{
"big" : ["http://i.imgur.com/CRSzQ4r.png", "http://i.imgur.com/l94Rfsj.png", "http://i.imgur.com/304PJ9p.png", "http://i.imgur.com/mOnnvms.png", "http://i.imgur.com/k5Eif3W.png", "http://i.imgur.com/xSVGJu4.png"],
"evil" : ["http://i.imgur.com/4s6OJQj.png", "http://i.imgur.com/su9edl7.png", "http://i.imgur.com/bCgGgBM.png"],
"grumpy" : ["http://i.imgur.com/EPGllv4.png", "http://i.imgur.com/DKFbRQ0.png", "http://i.imgur.com/bIqsqSK.png"],
"inHats" : ["http://i.imgur.com/6XcjacS.png", "http://i.imgur.com/GC3lgzg.png", "http://i.imgur.com/q7MZgiG.png", "http://i.imgur.com/VkfIH4a.png", "http://i.imgur.com/zy9cJgS.png", "http://i.imgur.com/OA4rZbW.png", "http://i.imgur.com/w0SzOoY.png", "http://i.imgur.com/zVZXKK4.png", "http://i.imgur.com/ZTn8bgI.png", "http://i.imgur.com/iVWFUlj.png"],
"kitten" : ["http://i.imgur.com/KqFuFSQ.png", "http://i.imgur.com/H3YmnA3.png", "http://i.imgur.com/qqWyfvA.png", "http://i.imgur.com/GS6HUnP.png", "http://i.imgur.com/bTvoEeb.png"]
}