Skip to content

Instantly share code, notes, and snippets.

View stefek99's full-sized avatar
🦄
Rainbows. Lasers. Unicorns.

Michal Stefanow stefek99

🦄
Rainbows. Lasers. Unicorns.
View GitHub Profile
@stefek99
stefek99 / gist:9074068
Created February 18, 2014 16:15
Very simple timestamp. Sortable output ```20141181-1392740100138```
var _filename = function() {
var now = new Date();
return now.getFullYear() + ('0' + now.getMonth()+1).slice(-2) + ('0' + now.getDate()+1).slice(-2) + "-" + now.getTime();
}
@stefek99
stefek99 / gist:9420591
Created March 7, 2014 21:31
gruntfile.js
// Generated on 2014-01-23 using generator-mobile 0.0.2
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:

Android - Phonegap - Cordova - Plugin - AdMob - Intents

(just remember to include your own jQuery / Zepto)

@stefek99
stefek99 / index.html
Last active August 29, 2015 14:23
Ember Data Starter Kit
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
</head>
<body>
<script type="text/x-handlebars">
<h2>Ember Starter Kit</h2>
@stefek99
stefek99 / index.html
Created June 20, 2015 07:55
AngularJS + AngularUI (Bootstrap)
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src='http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.1/ui-bootstrap-tpls.min.js'></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
@stefek99
stefek99 / issue.md
Created July 31, 2015 09:36
This is an unasked question I was about to create on StackOverflow

Possible duplicate: http://stackoverflow.com/questions/25779027/load-default-chrome-profile-with-webdriverjs-selenium

I'm trying to run Selenium automation and due to sophisticated authentication mechanisms (smart card + redirects) I'd like to use existing browser profile (rather than fresh browser instance each time).

I'm using JavaScript driver - https://code.google.com/p/selenium/wiki/WebDriverJs

var webdriver = require('selenium-webdriver');

var chromeOptions = webdriver.Capabilities.chrome();
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<script>
window.onerror = function(e) {
@stefek99
stefek99 / google-API.js
Created October 2, 2015 10:09
Authentication
exports.exchangeTokens = function(code) {
var defer = q.defer();
var requestURL = "https://www.googleapis.com/oauth2/v3/token";
var post_data = {
code : code,
client_id : google_client_id,
client_secret : google_client_secret,
redirect_uri : 'postmessage',
grant_type : "authorization_code",
@stefek99
stefek99 / thread-structure.json
Created October 4, 2015 22:27
How to make sense out of this data?
{
"id": "15033a9bcb309844",
"historyId": "173230",
"messages": [
{
"id": "15033a9bcb309844",
"threadId": "15033a9bcb309844",
"labelIds": [
"SENT",
"IMPORTANT"