π§βπ»
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
const url = new URLWrapper('https://example.com/?foo=bar&name=undefined&age=3'); | |
console.log(url.getParam('foo') === 'bar'); | |
console.log(url.getParam('name') === undefined); | |
console.log(url.getParam('age') === '3'); |
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
/** | |
* User Defined Values | |
*/ | |
const agreedDisclaimer = false; | |
const apiToken = ''; | |
/** | |
* Dont need to touch anything below | |
*/ | |
const readline = require('readline'); |
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
#!/usr/bin/env bash | |
set -e | |
# Handy script to auto use the Grails 3 version based on what is defined in the "gradle.properties". This script uses | |
# the Grails installed by the famous SDKMan so it will look the Grails installation at "~/.sdkman/candidates/grails" | |
# so only make sure the particular Grails version is installed using "sdk install grails <version>". | |
# | |
# The only thing to care about is that this script should be included first in the "PATH" before the | |
# ".sdkman/candidates/grails/current" is included. | |
# |
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 java.util.concurrent.TimeUnit | |
void convert(int secondsToConvert) { | |
long millis = secondsToConvert * 1000; | |
long hours = TimeUnit.MILLISECONDS.toHours(millis); | |
long minutes = TimeUnit.MILLISECONDS.toMinutes(millis) % TimeUnit.HOURS.toMinutes(1); | |
long seconds = TimeUnit.MILLISECONDS.toSeconds(millis) % TimeUnit.MINUTES.toSeconds(1); | |
String format = String.format("%02d:%02d:%02d", Math.abs(hours), Math.abs(minutes), Math.abs(seconds)); | |
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
yum install -y libpng | |
yum install -y libjpeg | |
yum install -y openssl | |
yum install -y icu | |
yum install -y libX11 | |
yum install -y libXext | |
yum install -y libXrender | |
yum install -y xorg-x11-fonts-Type1 | |
yum install -y xorg-x11-fonts-75dpi |
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 java.util.regex.Matcher | |
import java.util.regex.Pattern | |
Pattern urlPattern = Pattern.compile("\\b(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]",Pattern.CASE_INSENSITIVE); | |
String urlString = """This is a big string with lots of Image URL like: http://i.istockimg.com/file_thumbview_approve/69656987/3/stock-illustration-69656987-vector-of-flat-icon-life-buoy.jpg and | |
http://i.istockimg.com/file_thumbview_approve/69943823/3/stock-illustration-69943823-beach-ball.jpg few others below | |
http://i.istockimg.com/file_thumbview_approve/40877104/3/stock-photo-40877104-pollen-floating-on-water.jpg | |
http://i.istockimg.com/file_thumbview_approve/68944343/3/stock-illustration-68944343-ship-boat-flat-icon-with-long-shadow.jpg | |
""" |
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
#!/bin/bash --login | |
# Cf. http://stackoverflow.com/questions/33041109 | |
# | |
# Xcode 7 (incl. 7.0.1) seems to have a dependency on the system ruby. | |
# xcodebuild is screwed up by using rvm to map to another non-system | |
# rubyβ . This script is a fix that allows you call xcodebuild in a | |
# "safe" rvm environment, but will not (AFAIK) affect the "external" | |
# rvm setting. | |
# |
First you need subl
at the command line. Use this:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
...which came from Sublime's documentation here.
Next, open (Apple)Script Editor and paste this in:
tell application "Finder"
NewerOlder