Skip to content

Instantly share code, notes, and snippets.

View apt142's full-sized avatar
🐕
All dogs can lift Thor’s hammer.

Cris Bettis apt142

🐕
All dogs can lift Thor’s hammer.
  • Kannapolis, NC
View GitHub Profile
@gajus
gajus / gist:2f2d7cb9c674a8b8e86c
Created June 16, 2015 16:57
Erase the scrollback history.
/**
* Erase the scrollback history.
*/
function clearScrollback () {
if (php_sapi_name() !== 'cli') {
throw new Exception('Use of function in invalid interface context.');
}
$term_program = getenv('TERM_PROGRAM');
@andrewwatson
andrewwatson / cat.php
Created September 19, 2014 03:31
Respond to Twilio SMS with a random cat photo
<?php
$xml = new SimpleXmlElement(file_get_contents("http://thecatapi.com/api/images/get?format=xml&results_per_page=1&size=small"));
$cat_picture = $xml->data->images[0]->image->url;
?>
<Response>
<Message>
<Body>Meow!</Body>
<Media><?php echo $cat_picture; ?></Media>
</Message>
</Response>
@apt142
apt142 / jQueryDatePickerToBootstrap
Created May 19, 2014 17:55
jQuery Datepicker styled as Bootstrap Popover
#ui-datepicker-div {
padding: 1px 1px 5px;
text-align: left;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,.2);
border-radius: 6px;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
box-shadow: 0 5px 10px rgba(0,0,0,.2);
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@daz
daz / style.scss
Last active May 13, 2023 11:24 — forked from kevindavis/gist:1868651
Bootstrap styling for jQuery UI autocomplete
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;