Skip to content

Instantly share code, notes, and snippets.

@azend
azend / flat_ui_colors.xml
Created February 24, 2016 06:36
A transposition of the lovely colors from https://flatuicolors.com/ to Android
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- flat ui colors -->
<!-- a transposition of the lovely colors from https://flatuicolors.com/ -->
<color name="turqoise">#1abc9c</color>
<color name="green_sea">#16a085</color>
<color name="emerald">#2ecc71</color>
<color name="nephritis">#27ae60</color>
#!/bin/bash
POSTS_FOLDER="./_posts"
ASSETS_FOLDER="./assets"
read -p "Post name: " POST_PRETTY_NAME
read -p "Post categories: " POST_CATEGORIES
# generate post info
POST_DATE="$(date +%Y-%m-%d)"
Upstart -> service <service> start
Systemd -> systemctl start <service>
SysV init -> /etc/init.d/<service> start
diff --git a/youloop b/youloop
index 3cb99e7..b94f06f 100644
--- a/youloop
+++ b/youloop
@@ -9,9 +9,9 @@ function loop(){
mpv=`pgrep mpv`
if [[ $url == *"youtube"* && $mpv == "" ]]
then
+ echo "$url" > /tmp/youtubeurl
mpv --hwdec vaapi --ytdl-format=bestvideo[ext=mp4]+bestaudio[ext=m4a] "$url"
@azend
azend / youloop
Last active August 29, 2015 14:27 — forked from parkerlreed/Makefile
Script to monitor clipboard for a new Youtube URL and plays the video when the URL does not match the existing URL. Also does not run when an mpv instance is already running.
#!/bin/bash
function loop(){
sleep 2
url=`xclip -selection clipboard -o`
if [[ `cat /tmp/youtubeurl` == "$url" ]]
then
return
fi
mpv=`pgrep mpv`
if [[ $url == *"youtube"* && $mpv == "" ]]
<!-- A fairly normal copyright stamp with placeholder for current year -->
<p>&copy; Copywright <span class="copyrightYear"></span>, All rights reserved.</p>
<!-- Copywright date injection -->
<script type="text/javascript">
(function() {
function injectCopywrightDate() {
var year = new Date().getFullYear();
var placeholders = document.getElementsByClassName('copyrightYear');
@azend
azend / gist:6063249
Created July 23, 2013 15:23
jQuery Mobile GA link tracking
$('a').on('click', function (e) {
// jQuery Mobile uses anchor tags for slider handles...
//
// Using the following is less eloquent than using :not()
// but it is browser compliant.
if ( !$(this).hasClass('ui-slider-handle') ) {
var external = this.target === '_blank' || this.rel === 'external';
/**
* azend's theory on medical naming schemes
*/
function nameMedicalCondition ( mainSymptom, severity ) {
var name = mainSymptom;
if ( is_int(severity) && severity > 5 + ( Math.floor( Math.rand() * 4 ) - 2 ) ) {
name += 'icul';
}
@azend
azend / HeaterBox.py
Last active December 14, 2015 01:59
Simple python script to warm up a cold room
#!/usr/bin/env python
import argparse
import threading
class Worker(threading.Thread):
def run (self):
while True:
pass;
@azend
azend / gist:4665035
Last active December 11, 2015 21:48
Simple fade up using different colors on an rgb led. Works by overflowing the unsigned char until it rolls over.
/* Diyode CodeShield Pinout Constants */
#define ENCODER_A 14
#define ENCODER_B 15
#define ENCODER_PORT PINC
#define SWITCH 13
#define BUTTON 12
#define RGB_RED 11
#define RGB_GREEN 10
#define RGB_BLUE 9
#define LED 6