Skip to content

Instantly share code, notes, and snippets.

View iphone.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View sequence-diagrams-tampermonkey.js
// ==UserScript==
// @name Sequence Diagram in Github
// @version 0.1
// @description Use https://github.com/bramp/js-sequence-diagrams to put sequence diagrams in Github
// @match https://github.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.2.1/lodash.min.js
// @run-at document-end
// example in Github Issues
@ptbrowne
ptbrowne / addscript.js
Created Jun 5, 2014
AddScript Bookmarklet
View addscript.js
javascript:(function(){(function(){var el=document.createElement('div'),b=document.getElementsByTagName('body')[0],otherlib=false,msg='';function getScript(url,success){var script=document.createElement('script');script.src=url;var head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;success();script.onload=script.onreadystatechange=null;head.removeChild(script);}};head.appendChild(script);}getScript(prompt(),function(){if(typeof jQuery=='undefined'){msg='NOK';}else{msg='OK';if(otherlib){msg+=' and noConflict(). Use $jq(), not $().';}}return showMsg();});function showMsg(){console.log(msg)}})();})();
View jsbin.romeboqu.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Mobile Layout" />
<script src="//code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
<script src='//cdnjs.cloudflare.com/ajax/libs/hammer.js/1.1.3/hammer.min.js'></script>
<script src='//cdn.jsdelivr.net/jquery.hammerjs/1.1.2/jquery.hammer-full.js'></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8">
View designer.html
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
View fish_prompt.fish
function fish_prompt
if not set -q -g __fish_robbyrussell_functions_defined
set -g __fish_robbyrussell_functions_defined
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _is_git_dirty
echo (git status -s --ignore-submodules=dirty ^/dev/null)
end
View marionette.1.6.3.js
// MarionetteJS (Backbone.Marionette)
// ----------------------------------
// v1.6.3
//
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
//
// http://marionettejs.com
View README.md

git fix

Combines python-inquirer and git-amend-old to make git fix.

This gives you the possibility to amend a specific commit very easily.

Thanks to @magmax and @colinodell

https://github.com/magmax/python-inquirer

@ptbrowne
ptbrowne / README.md
Last active Aug 29, 2015
Toggle on/off Bluetooth from Spotlight
View README.md

Easy toggle on, toggle off bluetooth

Thanks to blueutil, it is possible to toggle Bluetooth from Spotlight, you just have to put to download blueutil and put it in one of the directory of your $PATH, then put those two scripts somewhere.

blueutil: http://www.frederikseiffert.de/blueutil/

View reorder-define.js
#! /usr/bin/env node
/*
This script is used to enforce a convention on the order
of the imports in a project that use requirejs
It will transform define calls dependency order according
to a priority.
Example:
You can’t perform that action at this time.