Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| // See https://lazycat.org/php-curl.html for license & known issues | |
| // P.S. You'd better have a very good reason for using this instead of http://guzzlephp.org/ | |
| function httpGet($url, $ttl = 86400) | |
| { | |
| /* Change this or make it an option as appropriate. If you're | |
| * getting urls that shouldn't be visible to the public, put the | |
| * cache folder somewhere it can't be accessed from the web | |
| */ |
| <!-- include jQuery --> | |
| <script> | |
| $('form').find('input:text').val( function(i, val) { | |
| return $(this).attr('name'); | |
| }); | |
| $('form').find('select').each( function(a) { | |
| $(this).find('option').each( function(b) { | |
| if ( $(this).val() !== '' ) { | |
| $(this).parent().val( $(this).val() ); |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <a href="javascript:(function(d,g,a,b,c,e,f,h,n,t,u,w,x){f=function(e,o,k){for(k in o)e.setAttribute(k,o[k])};c=function(e){return d.createElement(e)};n=function(s){return d.createTextNode(s)};a=function(e,c,k){for(k in c)e.appendChild(c[k])};w=c(g);h=c(g);t=n('Toggle Style-Elements');u=c('ul');b=d.querySelector('body');x='position:fixed;top:0;right:0;z-index:99999;margin:0;padding:0;background:#f4fff4;color:#99ad85;font:14px Helvetica,Arial,sans-serif;border:1px solid #bada55;border-top-width:0;border-right-width:0;border-bottom-left-radius:10px;';e=d.getElementById('tcss');if(b&&e)f(e,{style:x+(e.style.display=='none'?'':'display:none')});else if(b){f(w,{id:'tcss',style:x});f(h,{style:'font:20px Georgia,serif;padding:10px;margin:0;background:#dae7da;color:#693'});f(u,{style:'margin:0;padding:10px;list-style-type:disc'});f(u,{style:'margin:0;padding:10px;list-style-type:disc;'});a(b,[w]);a(w,[h,u]);a(h,[t]);[].slice.call(d.styleSheets).forEach(function(s,i,l,m,y,z){y='margin:0 0 0 20px;padding:0;cursor:point |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| # 1. Install mplayer command line (via Brew, Macports, or APT) | |
| # 2. Add the following aliases to ~/.profile | |
| # 3. Type `source ~/.profile` | |
| # 3. Type `news` or `current` to listen in your terminal | |
| alias news="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/news.pls" # MPR News | |
| alias current="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/the_current.pls" # The Current | |
| alias classical="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/classical.pls" # Classical MPR | |
| alias localcurrent="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/local.pls" # Local Current | |
| alias heartland="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/radio_heartland.pls" # MPR Radio Heartland |
| $.fn.scrollLock=function(){return $(this).on("DOMMouseScroll mousewheel",function(h){var g=$(this),f=this.scrollTop,d=this.scrollHeight,b=g.height(),i=h.originalEvent.wheelDelta,a=i>0,c=function(){h.stopPropagation();h.preventDefault();h.returnValue=false;return false};if(!a&&-i>d-b-f){g.scrollTop(d);return c()}else{if(a&&i>f){g.scrollTop(0);return c()}}})};$.fn.scrollRelease=function(){return $(this).off("DOMMouseScroll mousewheel")}; |
| // Future versions of Hyper may add additional config options, | |
| // which will not automatically be merged into this file. | |
| // See https://hyper.is#cfg for all currently supported options. | |
| module.exports = { | |
| config: { | |
| // default font size in pixels for all tabs | |
| fontSize: 14, | |
| // font family with optional fallbacks |
| /** | |
| * Advanced Window Snap | |
| * Snaps the Active Window to one of nine different window positions. | |
| * | |
| * @author Andrew Moore <andrew+github@awmoore.com> | |
| * @version 1.0 | |
| */ | |
| /** | |
| * SnapActiveWindow resizes and moves (snaps) the active window to a given position. |