Skip to content

Instantly share code, notes, and snippets.

View aapis's full-sized avatar
🐝

Яyan Priebe aapis

🐝
View GitHub Profile
@aapis
aapis / carousel.js
Last active May 3, 2016 21:53
JS carousel that supports multiple groups of "things"
@aapis
aapis / animate.js
Created June 14, 2016 19:57
Cross browser vanilla JS animation
function animate(callback, timeout){
var default_timeout = timeout || 50; // ms
if(window['requestAnimationFrame']){
window.requestAnimationFrame.call(null, callback);
}else {
window.setTimeout.call(null, callback, default_timeout);
}
}
@aapis
aapis / func.sh
Created June 29, 2016 16:08
Host/IP shortcut functions (bash)
ipfor(){
ping -c 1 $1 | awk -F'[()]' '{print $2}' | sed '/^$/d'
}
hostfor(){
whois $(ping -c 1 tgins.com | awk -F'[()]' '{print $2}' | sed '/^$/d')
}
@aapis
aapis / config.yml
Created July 12, 2016 19:57
Sample evertils configuration file
sections:
Daily:
Interesting Links:
- ...
templates:
Monthly:
"templates/monthly.enml"
@aapis
aapis / installwp.sh
Created September 21, 2016 22:46
Install the latest Wordpress in the current working directory
installwp(){
echo "Downloading Wordpress..."
wget http://wordpress.org/latest.zip
echo "Download complete, unzipping..."
unzip latest.zip
echo "Moving files..."
mv wordpress/* .
@aapis
aapis / initproject.sh
Last active September 25, 2018 16:35
Setup a whole new Wordpress site quickly so you can start themeing
initproject(){
: ${1?Domain argument required}
PROJECT_NAME=$1
CWD=`pwd`
echo "Creating project at $CWD/$PROJECT_NAME..."
mkdir $PROJECT_NAME && cd $PROJECT_NAME
echo "Downloading Wordpress..."
@aapis
aapis / verify.rb
Last active October 26, 2016 21:54
Simple website checker; compares the site's URL against a known string
#!/usr/bin/ruby
require "open-uri"
require "nokogiri"
NUM_HITS = 50
def _request(url)
begin
open(url, :read_timeout => 5).read
@aapis
aapis / daily.enml
Created December 6, 2016 21:18
daily.enml
<div><span style="font-size: 18px;">Logs</span></div>
<ul>
<li>...</li>
</ul>
<br />
<div><span style="font-size: 18px;">Meta</span></div>
<ul>
<li>Tasks Completed
<ul>
<li>...</li>
@aapis
aapis / applicant.php
Last active December 14, 2016 21:41
Should apply?
<?php
function starburstApplicant()
{
$coding_skills = array("awesome", "ninja-like");
$people_skills = array("great", "super-duper");
$should_apply = false;
if(in_array("awesome", $coding_skills) && in_array("great", $people_skills)) {
$should_apply = true;
#!/usr/bin/env ruby
# !IMPORTANT
# requires evertils-common 0.3.4/0.3.4.1-dev
require 'evertils/common'
require 'notifaction'
require 'date'
en = Evertils::Common::Query::Simple.new