Skip to content

Instantly share code, notes, and snippets.

@tylrd
tylrd / second file
Last active August 29, 2015 14:21
Test Gist
This is a test gist.
@tylrd
tylrd / gist:6de06aa371efbfd217a6
Created July 1, 2015 18:15
this is a test gist
def function
"this is a function"
end
@tylrd
tylrd / style.css
Created July 24, 2015 14:18
Importing fonts with sass
@import url(http://fonts.googleapis.com/css?family=Roboto);
@import "materialize/components/color";
$primary-color: color("blue", "lighten-2") !default;
@import "materialize";
@import "font-awesome-sprockets";
@import "font-awesome";
html, body, #map-canvas {
height: 100%;
margin: 0;
@tylrd
tylrd / map.js
Created July 24, 2015 14:18
map.js
function deleteDrawing(deleteDiv,shape){
var controlUI = document.createElement('div');
controlUI.className = "waves-effect waves-light btn button"
controlUI.innerHTML = "Clear Shape";
deleteDiv.appendChild(controlUI);
google.maps.event.addDomListener(controlUI,'click',function(){
if (selectedShape) {
selectedShape.setMap(null);
}
@tylrd
tylrd / github.rb
Created July 24, 2015 14:19
github wrapper
class Github
HOST = 'https://api.github.com'
ACCESS_TOKEN_URL = 'https://github.com/login/oauth/access_token'
DATA_URL = HOST + '/user'
attr_reader :data, :access_token
def initialize(params)
@params = {
@tylrd
tylrd / stack.rb
Last active September 6, 2015 21:05
stack overflow
class Stack
BASE = "https://api.stackexchange.com/"
TAGS = "/2.2/tags"
ACCESS_KEY = ENV['STACK_KEY']
WRITE_FILE_PAGE = File.expand_path("~/Desktop/tags.txt")
WRITE_ALL_FILE = File.expand_path("~/Desktop/all_tags.txt")
attr_reader :tags
def index
params[:page] ? page = params[:page].to_i : page = 1
sort = params[:sort]
if params[:tags]
stripped_tags = params[:tags].gsub(/\s+/, "")
tags = stripped_tags.split(",")
end
if page == 1
@tylrd
tylrd / default-ssl.conf
Last active July 20, 2019 17:39
setting up apache in ubuntu
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin admin@example.com
ServerName your_domain.com
ServerAlias www.your_domain.com
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
@tylrd
tylrd / setup.sh
Last active September 9, 2015 15:24
ansible
openssl req \
-newkey rsa:2048 -nodes -keyout files/nginx.key \
-x509 -days 365 -out files/nginx.crt
- name: configure webserver with nginx and tls
hosts: webservers
sudo: True
vars:
key_file: /etc/nginx/ssl/nginx.key
cert_file: /etc/nginx/ssl/nginx.crt