This file contains 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" | |
"log" | |
"os" | |
"github.com/go-ozzo/ozzo-validation" | |
"github.com/go-ozzo/ozzo-validation/is" | |
"github.com/manifoldco/promptui" |
This file contains 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
git branch [Feature]-squashed | |
git checkout [Feature]-squashed | |
git reset --hard upstream/master | |
git merge --squash upstream/[Feature] | |
git commit -m "squashed [Feature] PR to one commit" | |
git push origin [Feature]-squashed |
This file contains 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 python | |
import os | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') | |
CHECKS = [ |
This file contains 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
US Domestic Phone Numbers | |
\(\d{1,3}\)([\s\.\-])\d{3,4}(?:\1|\-)?\d{4,6}\b | |
International Phone Numbers | |
\+\d{1,3}([\s\.\-])(?:\(\d{1,3}\)|\d{1,3})\1\d{3,4}(?:\1|\-)?\d{4,6}\b | |
Street Address | |
\b\d{1,7}(?:\-?[A-Z]?|st|nd|rd|th)(?:\s[\w']+){1,4}\s(?:W|E|N|S|NE|NW|SE|SW|ave|ct|street|st|dr|ln|rd|blvd)\b |
This file contains 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
wget http://efele.net/maps/tz/world/tz_world_mp.zip | |
unzip tz_world_mp.zip | |
ogr2ogr -progress -lco engine=MYISAM -f MySQL MySQL:test,user=root,password='password' world/tz_world.shp |
This file contains 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
# Basic Play Options | |
## Play/Pause/Previous/Next | |
tell application "Google Chrome" | |
repeat with w in (every window) | |
repeat with t in (every tab whose URL contains "play.google.com/music") of w | |
# Options for action are: | |
# 1 = previous | |
# 2 = play/pause | |
# 3 = next |
This file contains 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 models | |
import play.api.libs.json._ | |
import org.joda.time.{DateTimeZone, DateTime, LocalDateTime} | |
import reactivemongo.bson.BSONDateTime | |
import reactivemongo.bson.BSONReader | |
import reactivemongo.bson.BSONWriter | |
object MongoDateTime { |
This file contains 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
MySQL | |
CREATE DEFINER=`root`@`localhost` FUNCTION `HAVERSINE`(`coord1` POINT, `coord2` POINT) RETURNS double | |
NO SQL | |
BEGIN | |
DECLARE dist DOUBLE; | |
SET dist = ACOS( COS( radians( X( coord1 ) ) ) * COS( radians( Y( coord1 ) ) ) * COS( radians( X( coord2 ) ) ) * COS( radians( Y( coord2 ) ) ) + COS( radians( X( coord1 ) ) ) * SIN( radians( Y( coord1 ) ) ) * COS( radians( X( coord2 ) ) ) * SIN( radians( Y( coord2 ) ) ) + SIN( radians( X( coord1 ) ) ) * SIN( radians( X( coord2 ) ) ) ) * 6372.8; | |
RETURN dist; | |
END |
This file contains 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
// Photoshop Script to Create iPhone Icons from iTunesArtwork // // WARNING!!! In the rare case that there are name collisions, this script will // overwrite (delete permanently) files in the same folder in which the selected // iTunesArtwork file is located. Therefore, to be safe, before running the // script, it's best to make sure the selected iTuensArtwork file is the only // file in its containing folder. // // Copyright (c) 2010 Matt Di Pasquale // Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and |
This file contains 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 | |
# | |
# ========================================================================= | |
# Copyright 2014 Rado Buransky, Dominion Marine Media | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
NewerOlder