Skip to content

Instantly share code, notes, and snippets.

View joetemp's full-sized avatar
🏆
Leveling up

Joe joetemp

🏆
Leveling up
View GitHub Profile
@joetemp
joetemp / Center Aspect
Last active August 29, 2015 14:01
A mixin that maintains aspect ratio and always stays centered. You simply feed it a width and an aspect ratio.
@mixin center_aspect($width, $aspect) {
width: $width;
$height: $width * $aspect;
height: $height;
max-height: 90%;
left: 50%;
top: 50%;
margin-left: - ($width / 2);
margin-top: - ($height / 2);
}
@joetemp
joetemp / slider.js
Created July 19, 2014 21:42
Slider
// Global variable declarations
var i = 1;
var nudge = -50;
var bigNudge = -100;
var imgs = document.getElementsByTagName('img');
$( document ).ready(function(){
@joetemp
joetemp / blurTargets.js
Last active August 29, 2015 14:04
Blur targets
$(document).ready( function() {
// This is the proper way to use blur.js. Too bad it only works on one element...
$('.b1').blurjs({ // Area to be blurred.
source: '.b1', // Target photo.
radius: 15 // In THIS CASE... they happen to be the same for cleaner markup.
});
/**
@joetemp
joetemp / structure.html
Created May 27, 2015 21:59
HTML5 Page Structure
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Your Website</title>
</head>
<body>
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
[Unit]
Description=Start test
[Service]
WorkingDirectory=/home/admin
Type=simple
ExecStart=/bin/bash sync_test1.sh start
KillMode=process
[Install]
@joetemp
joetemp / startup_test.service
Created October 10, 2015 05:50
/etc/systemd/system/startup_test.service
[Unit]
Description=Start rsync
[Service]
Type=oneshot
ExecStart=/usr/bin/sync_test
[Install]
WantedBy=multi-user.target
@joetemp
joetemp / sync_test
Created October 10, 2015 05:53
/usr/bin/sync_test
#!/bin/sh
while inotifywait -e create photos; do
rsync -r -e 'ssh -p 28000' photos/ [email protected]:/srv/http/trailcam/vps_test
done
function logFunction() {
var test = "Yay... my function is working";
console.log(test);
}
logFunction;
const request = require('request');
var url = {deals: 'https://api.pipedrive.com/v1/deals?start=0&api_token=a74cbe24c7ac34f45256356a747eaebf96445c94',
activities: 'https://api.pipedrive.com/v1/activities?start=0&api_token=a74cbe24c7ac34f45256356a747eaebf96445c94'};
function getDeals (url, callback) {
request(url, function (error, response, body) {
if (error) {
return console.log(error);