Skip to content

Instantly share code, notes, and snippets.

View rayantony's full-sized avatar

ray anthony rayantony

View GitHub Profile
@rayantony
rayantony / README.md
Last active November 2, 2017 23:51
Page Info 🔍 JS Bookmarklet

Page Info 🔍 JS Bookmarklet

summary:

lightweight dependency free simul-display of current page info to both the console and alert box, including a quine (program that produces as output...itself)

usage:

paste in address bar and hit enter, or save as bookmark on your toolbar make sure it starts with javascript: name it whatever you want. easy!

2 variations, but virtually the same

➕ ver 1

javascript:!function $(){var bs='\n',p='origin: '+window.location.origin+bs,a='title: '+document.title+bs,g='href: '+location.href+bs,e='hash: '+location.hash+bs,i='agent: '+navigator.appVersion+bs,n='last mod: '+document.lastModified+bs,f='current: '+Date()+bs+bs,o='javascript: '+bs+'!'+$+'()',str=p+a+g+e+i+n+f+o;console.log(str);window.alert(str);}()
@rayantony
rayantony / deploy.sh
Created October 30, 2017 11:46
vault s3cmd bash script
#!/bin/bash
set -e
PROJECT="vault"
PROJECT_URL="www.vaultproject.io"
FASTLY_SERVICE_ID="7GrxRJP3PVBuqQbyxYQ0MV"
# Ensure the proper AWS environment variables are set
if [ -z "$AWS_ACCESS_KEY_ID" ]; then
echo "Missing AWS_ACCESS_KEY_ID!"
@rayantony
rayantony / chrub.pod
Last active September 30, 2017 07:58
POD Files Specs, Usage, Examples
@rayantony
rayantony / dillinger.md
Last active December 15, 2023 03:11
Markdown Cheat Sheets Multi Platform

Dillinger

N|Solid

Dillinger is a cloud-enabled, mobile-ready, offline-storage, AngularJS powered HTML5 Markdown editor.

  • Type some Markdown on the left
  • See HTML in the right
  • Magic
@rayantony
rayantony / README.md
Last active September 24, 2017 00:13
Web Page Translation Bookmark Tool

Translate page Bookmarklet

one click translating of any page!

Basic Description

Translate Page is a simple tool of a class referred to as Bookmarklets commonly. Literally a javascript function, a bookmark but with some extra powers but conveniently still embedddable on your bookmark bar like any other shortcut. This hybrid bookmark enabled you to quickly, and easily translate into english, whatever page you are currently viewing. Think of it is a extension or app that you dont have to download and slow the browser down with, or worry about malware.

It's a quick and dirty solution, it works by grabbin all the text by default including menus, navigation anything 'text', encodes it for transport navigates to the Google Translator™ and auto imports the contents for your perusal and pleasure. Again, the simplest, fastest most complete solution without further refinement or consideration but likewis

@rayantony
rayantony / demo.html
Last active August 27, 2017 01:07
gcp prettify
<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<script src="https://raw.githubusercontent.com/rayantony/code-prettify/master/src/prettify.js"></script>
<script src="https://raw.githubusercontent.com/rayantony/code-prettify/master/src/lang-css.js"></script>
<style type="text/css">
body { margin: 0; padding: 0; }
pre { margin: 0; }
#container { width: 40em; display: inline-block; }
@rayantony
rayantony / vanillajsjquery.md
Created August 22, 2017 09:22
Vanilla JS and Jquery

Vanilla JavaScript

Some vanilla equivalents to jQuery methods.

DOM selectors

jQuery:

@rayantony
rayantony / app.py
Created July 16, 2017 00:07 — forked from meganspeir/app.py
The Martian
import requests
from flask import Flask
from flask import request, send_from_directory
from twilio import twiml
from martianify import martianify
UPLOAD_FOLDER = '/path/to/your/project/'
# App declaration and configuration
@rayantony
rayantony / video-canvas-mirror.html
Created June 10, 2017 22:32
video canvas mirror snip
<style> #mycanvas { position: absolute; margin: 0 auto; top: 0; bottom: 0; left: 0; right: 0; width: 75%; height: 75%; -webkit-filter: grayscale(1); } #video1 { position: absolute; left: 0; }</style> <script> document.addEventListener('DOMContentLoaded', function(){ var v = document.getElementById('video1'); var canvas = document.getElementById('mycanvas'); var context = canvas.getContext('2d'); var cw = 320; var ch = 240; canvas.width = cw; canvas.height = ch; v.addEventListener('play', function(){ draw(this,context,cw,ch); },false); },false); function draw(v,c,w,h) { if(v.paused || v.ended) return false; c.drawImage(v,0,0,w,h); setTimeout(draw,20,v,c,w,h); } </script> <canvas id='mycanvas'></canvas> <video id='video1' controls='controls' width='320'> <source src="http://media.w3.org/2010/05/sintel/trailer.mp4" type="video/mp4" /> <source src="http://media.w3.org/2010/05/sintel/trailer.webm" type="video/webm" /> <source src="http://media.w3.org/2010/05/sintel/trailer.ogv" type="video/ogg" /></video>
@rayantony
rayantony / README.md
Last active May 26, 2017 11:39
comparison of css github then xtras

Xtras comparison

===

From README.md function at bottom:

(function(){var style=document.createElement('style'),styleContent=document.createTextNode('p,footer,header,a:link,article,soundmanager,video,input,post,h1,hr,h3{animation-delay:1.5s;animation:fly-in-from-right 0.93s 1s ease both;transform-origin:top right;}top-panels,h2,h4,h5,img,.bottom-panels,list-item,list,li,.list-group-item,ol,shop,dd,shop-button,shop-item,cart,ad,figure{animation-delay:1.8s;animation:fly-in-from-left 2.93s 1.2s ease both;-webkit-animation-delay:1.8s;-webkit-animation:fly-in-from-left 2.93s 1.5s ease both;transform-origin:top left;}@keyframes fly-in-from-top{from{transform:translateX(12rem) rotate(90deg);opacity:0;}}@keyframes fly-in-from-left{from{transform:translateY(12rem) rotate(180deg);opacity:0;}}@keyframes fly-in-from-right{from{transform:translateY(12rem) rotate(-360deg);opacity:0;}}frame,iframe,section{animation-delay:2s;animation:fly-in-from-l