Skip to content

Instantly share code, notes, and snippets.

View printminion's full-sized avatar
💭
Time flies like an arrow; fruit flies like a 🍌

@printminion printminion

💭
Time flies like an arrow; fruit flies like a 🍌
View GitHub Profile
@printminion
printminion / api.test.php
Last active December 5, 2018 17:50
Do cURL request to some API with cookie parsing
/**
* @desc Do cURL request to some API
* @author Misha M.-Kupriyanov https://plus.google.com/104512463398531242371/
* @link https://gist.github.com/5055906
*/
$currentSID = null;
$SESSION_NAME = '<PUT_YOUR_SESSION_NAME_HERE>';
$API_KEY = '<PUT_YOUR_API_KEY_HERE>';
$API_URL = 'http://host/api/v1/?alt=json'
@printminion
printminion / SecureHash.php
Created March 1, 2013 15:33
function for signing values
<?php
class SecureHash
{
const SECRET = 'PUT_YOUR_SECRET_HERE';
const SEPARATOR = '|';
/**
* hash string
@printminion
printminion / ingressPortalSrength.js
Last active May 7, 2018 11:27
Show ingress portal range circle in http://www.ingress.com/intel map
/**
* @desc Inject ingress portal range circle
* @author Misha M.-Kupriyanov https://plus.google.com/104512463398531242371/
* @link https://gist.github.com/5224508
*/
//More info on ranges http://ingressfieldguide.com/content/portals-linking
//goto http://www.ingress.com/intel?latE6=48740985&lngE6=9253478&z=19
// open your console and paste this code
java -jar /usr/share/java/batik-rasterizer-1.7.jar -m application/pdf 11_0520_PREVIEW.svg -scriptSecurityOff
@printminion
printminion / selenium.sh
Created March 23, 2013 12:33
selenium stuff
#start selenium headless on display 1
Xvfb :1 -screen 1 1024x768x24 2>&1 >/dev/null &
export DISPLAY=:1
nohup xvfb-run java -jar selenium-server-standalone-2.2.0.jar > selenium-rc.log &
#run selenium task with custom firefox profile
java -jar /var/lib/selenium/selenium-server.jar -singleWindow -firefoxProfileTemplate /home/cr/.mozilla/firefox/umzxo5dc.default/ -htmlSuite " *firefox /usr/lib/firefox/firefox" http://www.googe.com/ /home/cr/bin/selenium/m.kupriyanov/ingress/make_screenshot.html "./result.html"
@printminion
printminion / onePixel.md
Last active December 15, 2015 10:09
one pixel gif - base64 encoded

#Image tag <img alt="" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" />

#CSS background background-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==);

function doGet() {
var app = UiApp.createApplication();
var t = app.createTextBox().setName('t').setId('t');
app.add(t);
app.add(app.createButton('OK', app.createServerHandler('click').addCallbackElement(t)));
return app;
}
function click(e) {
var app = UiApp.getActiveApplication();
if(e.parameter.t == '') return;
function doGet() {
var app = UiApp.createApplication();
var t = app.createTextBox().setName('t').setId('t');
app.add(t);
app.add(app.createButton('OK', app.createServerHandler('click').addCallbackElement(t)));
return app;
}
function click(e) {
var app = UiApp.getActiveApplication();
if(e.parameter.t == '') return;
@printminion
printminion / SocialAPIServiceClient.gs
Last active September 8, 2022 00:48
Client Script for SocialAPIWebService
/**
* Client Script for SocialAPIWebService
* add this script to your spreadsheet and you will be able to get followers
* via formula e.g. =getTwitterCount(A2)
* Example: https://lh6.googleusercontent.com/-EPK-mUtK6-o/UWm_nEpo2UI/AAAAAAAAru0/20a0lk2nIiQ/s0/SocialAPIService.gif
* @author Misha M.-Kupriyanov <m.kupriyanov@gmail.com>
* @license Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0
*/
/*
function testGA() {
doTrack_('UA-NNNNNN-1', 'YORR_KEY', 'YOUR_SERVICE', 'YOUR_ID');
}
function doTrack_(utmac, key, service, user) {
var path = '/' + key + '/' + service + '/' + user;
try {
var host = 'YOUR_HOST';
var utmGifLocation = "http://www.google-analytics.com/__utm.gif";