This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return new Promise((resolve, reject) => { | |
Linking.openURL(url.join('')) | |
.then(() => { | |
const handleUrl = url => { | |
if (!url || url.indexOf('fail') > -1) { | |
reject(url) | |
} else { | |
resolve(url) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const b64toBlob = (b64Data, contentType='', sliceSize=512) => { | |
const byteCharacters = atob(b64Data); | |
const byteArrays = []; | |
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) { | |
const slice = byteCharacters.slice(offset, offset + sliceSize); | |
const byteNumbers = new Array(slice.length); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-option -g prefix C-a | |
bind-key C-a last-window | |
# Start numbering at 1 | |
set -g base-index 1 | |
# Allows for faster key repetition | |
set -s escape-time 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export ZSH=/Users/mgenov/.oh-my-zsh | |
ZSH_THEME="cloud" | |
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) | |
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ | |
# Example format: plugins=(rails git textmate ruby lighthouse) | |
# Add wisely, as too many plugins slow down shell startup. | |
plugins=(git) | |
source $ZSH/oh-my-zsh.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Question { | |
private String name; | |
private String status; | |
private String module; | |
public Question(String name, String status, String module) { | |
this.name = name; | |
this.status = status; | |
this.module = module; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import angular from 'angular' | |
/** | |
* `require` all modules in the given webpack context | |
*/ | |
function requireAll(context) { | |
context.keys().forEach(context); | |
} | |
// Collect all angular modules | |
requireAll(require.context( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void fetchCustomers() throws Exception { | |
final User anyAdminUser = newUser().markAsAdmin().build(); | |
context.checking(new Expectations() {{ | |
oneOf(userSecurity).currentUser(); | |
will(returnValue(anyAdminUser)); | |
oneOf(customerBase).fetchCustomers(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Jetty { | |
private final Server server; | |
public Jetty(int port) { | |
this.server = new Server(port); | |
} | |
public void start() { | |
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"/> | |
<title>Title of the document</title> | |
<script type="text/javascript"> | |
var count = 0; | |
function handleClick() { | |
console.log("Count: " + count) | |
count++; |