Skip to content

Instantly share code, notes, and snippets.

View derblub's full-sized avatar
✌️
I might be interested in cooperation.

Daniel Kurdoghlian derblub

✌️
I might be interested in cooperation.
View GitHub Profile
@derblub
derblub / LICENSE.txt
Created September 28, 2011 14:34 — forked from p01/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri <http://www.p01.org/releases/>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
/**
* Like, basically PERFECT scrollbars
*/
/*
It's pure CSS.
Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars...
this has no fade-out effect.
In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting.
@derblub
derblub / urls.py
Last active December 28, 2015 02:29
Quick one-liner to serve a robots.txt file directly from your urls.py in Django.
##################################################################################
# SERVING robots.txt FILE - should be removed on production and handled by
# the webserver directly (no need for django here)
url(r'^robots\.txt$', lambda r: HttpResponse("User-agent: *\nDisallow: /", mimetype="text/plain")),
##################################################################################
-- Quick launchbar widget for Awesome WM
-- http://awesome.naquadah.org/wiki/Quick_launch_bar_widget/3.5
-- Put into your awesome/ folder and add the following to rc.lua:
-- local launchbar = require('launchbar')
-- local mylb = launchbar("/path/to/directory/with/shortcuts")
-- Then add mylb to the wibox.
local layout = require("wibox.layout")
local util = require("awful.util")
local launcher = require("awful.widget.launcher")
/* Original is in LESS and can be found here: https://gist.github.com/gefangenimnetz/3ef3e18364edf105c5af */
@mixin material-shadow($level:1){
@if $level == 1 {
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
@else if $level == 2 {
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}
@derblub
derblub / readme.md
Last active August 29, 2015 14:16 — forked from paulirish/readme.md

console.log wrap resolving for your wrapped console logs

I've heard this before:

What I really get frustrated by is that I cannot wrap console.* and preserve line numbers

We enabled this in Chrome DevTools via blackboxing a bit ago.

If you blackbox the script file the contains the console log wrapper, the script location shown in the console will be corrected to the original source file and line number. Click, and the full source is looking longingly into your eyes.

@derblub
derblub / spotify.nowplaying.sh
Last active March 20, 2024 23:15
Get playback status from Spotify via DBus
#!/bin/bash
# if spotify is started
if [ "$(pidof spotify)" ]; then
# status can be: Playing, Paused or Stopped
status=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'|egrep -A 1 "string"|cut -b 26-|cut -d '"' -f 1|egrep -v ^$`
artist=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "artist"|egrep -v "artist"|egrep -v "array"|cut -b 27-|cut -d '"' -f 1|egrep -v ^$`
album=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "album"|egrep -v "album"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$`
title=`dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 o
#!/usr/bin/env python
# 8 bar Audio equaliser using MCP2307
import alsaaudio as aa
import smbus
from time import sleep
from struct import unpack
import numpy as np
@derblub
derblub / index.html
Created October 18, 2016 11:08
Sass parallax example
<div class="container">
<h1>Parallax</h1>
<h2>faster</h2>
<h2>easier</h2>
<h2>sassier</h2>
<img src="http://placekitten.com/200/200" alt=" " />
<img src="http://placekitten.com/150/200" alt=" " />
<img src="http://placekitten.com/200/150" alt=" " />
<img src="http://placekitten.com/150/250" alt=" " />
<img src="http://placekitten.com/300/400" alt=" " />