Skip to content

Instantly share code, notes, and snippets.

View OdinsHat's full-sized avatar
💭
Open to job offers

Doug OdinsHat

💭
Open to job offers
View GitHub Profile
@OdinsHat
OdinsHat / setperm.sh
Last active December 8, 2017 10:44
Permissions settings for most frameworks
find ./ -type f -exec chmod 644 {} \;
find ./ -type d -exec chmod 755 {} \;
chown www-data:www-data * -R
@OdinsHat
OdinsHat / web-servers.md
Created November 19, 2017 23:45 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@OdinsHat
OdinsHat / keybase.md
Created September 26, 2017 07:20
My keybase.io proof of ID

Keybase proof

I hereby claim:

  • I am odinshat on github.
  • I am lokisjaguar (https://keybase.io/lokisjaguar) on keybase.
  • I have a public key ASALKCZZw0r5JZiOrb0xPUnOrvGuRpVPw0RFWfBr_iU03go

To claim this, I am signing this object:

@OdinsHat
OdinsHat / html_additions.html
Created September 10, 2017 15:48
Basic Recaptcha Implementation in PHP
<!-- Add htis to the <head> of the page -->
<script src='https://www.google.com/recaptcha/api.js'></script>
<!-- Add this to the location of wher eyou want the recaptcha to go -->
<div class="g-recaptcha" data-sitekey="SITEKKEY"></div>
SELECT ?item ?dt ?date (COUNT(distinct ?sitelink) as ?count)
WHERE { values ?offsetmin { "1920-02-27T00:00:00"^^xsd:dateTime }. values ?offset0 { "1920-02-17T00:00:00"^^xsd:dateTime }. values ?offsetmax { "1920-02-07T00:00:00"^^xsd:dateTime }.
VALUES ?filmtype {wd:Q11424 wd:Q24862 wd:Q506240 wd:Q336144} .
Bind((NOW() - ?offsetmin) as ?mintime).
Bind((NOW() - ?offsetmax) as ?maxtime).
?item wdt:P31 ?filmtype .
?item p:P577/psv:P577 ?date node .
?date node wikibase:timeValue ?date .
FILTER (?date > "2015-12-31T00:00:00Z"^^xsd:dateTime) ?date node wikibase:timePrecision "11"^^xsd:integer . Bind((?date - ?offset0) as ?datetime ). FILTER ( ?datetime > ?mintime ) . FILTER ( ?datetime < ?maxtime ) . BIND (SUBSTR(Str(?date),1,10) as ?dt) . OPTIONAL { ?sitelink <http://schema.org/about> ?item . } }
GROUP BY ?item ?dt ?date
@OdinsHat
OdinsHat / full-error-installing teensyduino Arch Linux (Aug 2017)
Last active August 26, 2017 14:51
Can't install teensyduino on Arch Linux
```
[...]
Cloning into 'teensy_loader_cli'...
done.
Switched to a new branch 'makepkg'
-> Extracting arduino-1.8.2-linux64.tar.xz with bsdtar
==> Starting build()...
-> Running Teensyduino installer (takes around 50 seconds)
==> ERROR: A failure occurred in build().
Aborting...
@OdinsHat
OdinsHat / telephone-microdata.html
Created May 2, 2017 16:36
Terlephone number microdata example.
<div itemscope itemtype="http://schema.org/LocalBusiness">
<h1 itemprop="name">Beach Bunny Swimwear</h1>
Phone: <span itemprop="telephone"><a href="tel:+18506484200">
850-648-4200</a></span>
</div>
@OdinsHat
OdinsHat / blutooth-fix.sh
Created January 13, 2017 21:28
Commands for fixing bluetooth problems in (Arch) Linux
# This isn't a script but a list of commands
# for helping to fix bluetooth issues
yaourt -S bluez bluez-libs bluez-utils # these are essential
sudo rfkill list # lists the hci devices and their states
sudo rfkill unblock bluetooth # unblocks bluetooth re-enabling you to use it
bluetoothctl #use "help" for command list
@OdinsHat
OdinsHat / css_resources.md
Last active August 29, 2015 14:25 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@OdinsHat
OdinsHat / python_resources.md
Last active August 29, 2015 14:25 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides