Skip to content

Instantly share code, notes, and snippets.

View SBejga's full-sized avatar

Sebastian Bejga SBejga

View GitHub Profile
@SBejga
SBejga / chrome_multiple_open.sh
Created October 15, 2016 22:47
Open Multiple Chrome Windows
# helper bash script to open multiple chrome windows at given position and size
# works at mac os x sierra
open -n -g -a /Applications/Google\ Chrome\ Canary.app --args --new-window --app="data:text/html,<html><body><script>window.resizeTo(500,1000);window.moveTo(1200,50);window.location='http://localhost:8000/server/';</script></body></html>"
open -n -g -a /Applications/Google\ Chrome\ Canary.app --args --new-window --app="data:text/html,<html><body><script>window.resizeTo(1100,300);window.moveTo(70,50);window.location='http://localhost:8000/';</script></body></html>"
open -n -g -a /Applications/Google\ Chrome\ Canary.app --args --new-window --app="data:text/html,<html><body><script>window.resizeTo(1100,300);window.moveTo(70,350);window.location='http://localhost:8000/';</script></body></html>"
open -n -g -a /Applications/Google\ Chrome\ Canary.app --args --new-window --app="data:text/html,<html><body><script>window.resizeTo(1100,300);window.moveTo(70,650);window.location='http://localhost:8000/';</script><
var request = require('request');
var reverseGeocode = function(locationName, callback) {
request({
uri: "http://nominatim.openstreetmap.org/search?format=json&q="+locationName,
json: true
}, function(err, response, body) {
if (err) { return callback(err, null); }
else {
if (body && body.length) {
@SBejga
SBejga / package.json
Last active October 18, 2016 07:41
reverse Geocoding example with typescript
{
"name": "3_tsconfig",
"version": "1.0.0",
"description": "",
"main": "old.js",
"scripts": {
"demo": "tsc && node build/js/reverseGeo.js 'Stuttgart, Germany'"
},
"author": "",
"license": "Apache-2.0",
@SBejga
SBejga / fsPromise.ts
Last active February 27, 2017 16:02
pwa-3 practice: read json file async with promises (typescript)
var fs = require('fs');
//npm install @types/node @types/es6-promise
function loadFromJson(filename: string) {
//TODO: read files async with Promises
}
var files: string[] = [
"good.json", "absent.json", "good2.json", "invalid.json", "good3.json"
];
@SBejga
SBejga / remove_cocoapods.sh
Created September 19, 2017 13:15
remove cocoapods from mac machine
# credits: https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
# remove gems
for i in $( gem list --local --no-version | grep cocoapods );
do
gem uninstall $i;
done
# Additionally delete ~/.cocoapods to remove the cache of podspecs.
@SBejga
SBejga / GIF-Screencast-OSX.md
Created October 25, 2017 11:33 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: