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
| <?php | |
| if ($message->hasAttachments()) { | |
| $attachments = $message->getAttachments(); | |
| $location = []; | |
| foreach ($attachments as $attachment) { | |
| switch($attachment['type']) { | |
| case 'location': | |
| $lat = $attachment['payload']['coordinates']['lat']; | |
| $long = $attachment['payload']['coordinates']['long']; |
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
| // ==UserScript== | |
| // @name Wikipedia English Translation | |
| // @namespace https://wikipedia.org/* | |
| // @version 0.0.4 | |
| // @downloadURL https://gist.github.com/raw/bfc145808a639f85a02dfe03cd03cf60/WikipediaEnglishTranslation.user.js | |
| // @updateURL https://gist.github.com/raw/bfc145808a639f85a02dfe03cd03cf60/WikipediaEnglishTranslation.meta.js | |
| // @description Add the English term to the current term's title. | |
| // @include https://*wikipedia.org/* | |
| // @match https://*wikipedia.org/* | |
| // @grant GM_setValue |
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
| <?php | |
| namespace GuzzleHttp\Handler; | |
| use GuzzleHttp\Promise as P; | |
| use GuzzleHttp\Promise\Promise; | |
| use GuzzleHttp\Psr7; | |
| use Psr\Http\Message\RequestInterface; | |
| /** | |
| * Returns an asynchronous response using curl_multi_* functions. |
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
| // ==UserScript== | |
| // @name KindleKeywordsExporter | |
| // @namespace https://kindle.amazon.com/your_highlights | |
| // @version 0.0.8 | |
| // @downloadURL https://gist.github.com/raw/65e198dcda8784c557075b9b89265a16/kindle.user.js | |
| // @updateURL https://gist.github.com/raw/65e198dcda8784c557075b9b89265a16/kindle.meta.js | |
| // @description Helps exporting highlighted keywords from Kindle | |
| // @include https://kindle.amazon.com/your_highlights | |
| // @match https://kindle.amazon.com/your_highlights | |
| // @grant GM_setValue |
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
| // ==UserScript== | |
| // @name Sedarot - show video | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.12 | |
| // @downloadURL https://gist.github.com/raw/84aef3ef6544f9efc92c25c6485e5a33/sratim.js | |
| // @updateURL https://gist.github.com/raw/84aef3ef6544f9efc92c25c6485e5a33/sratim.meta.js | |
| // @description try to take over the world! | |
| // @author You | |
| // @match http://www.sdarot.pm/watch/* | |
| // @grant none |
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 com.rg.stash.plugin.commit.url.hook; | |
| import com.atlassian.stash.hook.*; | |
| import com.atlassian.stash.hook.repository.*; | |
| import com.atlassian.stash.repository.*; | |
| import java.util.Collection; | |
| public class UrlCommitHook implements PreReceiveRepositoryHook { | |
| /** |
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
| byte[] buffer = new byte[1024]; | |
| InputStream reader = new BufferedInputStream(is); | |
| OutputStream writer = new BufferedOutputStream(os); | |
| int read; | |
| while ((read = reader.read(buffer)) != -1) { | |
| writer.write(buffer, 0, read); | |
| } | |
| writer.flush(); | |
| writer.close(); |
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
| <?php | |
| # Copyright (c) 2015, phpfmt and its authors | |
| # All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
| # | |
| # 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
| # | |
| # 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
| # |
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
| // Look for a certain process | |
| def p = "ps -e".execute() | "grep java".execute() | "grep -v grep".execute() | |
| p.waitFor() | |
| // Show PID | |
| println p.text.trim().split(" ")[0] |