This is a train window.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
player_status=$(playerctl status 2> /dev/null) | |
if [ "$player_status" = "Playing" ]; then | |
echo "$(playerctl metadata artist) - $(playerctl metadata title)" | |
elif [ "$player_status" = "Paused" ]; then | |
echo "Paused - $(playerctl metadata artist) - $(playerctl metadata title)" | |
else | |
echo "#3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# General format of my i3 configuration file | |
# Uses colors from .Xresources to color windowborders | |
# Now it uses polybar for configuration. | |
# i3 config file (v4) | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! | |
# Set mod key (Mod1=<Alt>, Mod4=<Super>) | |
set $mod Mod4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic script to kill all old bars and launch new. | |
# Terminate already running bad instances | |
killall -q polybar | |
if type "xrandr"; then | |
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do | |
MONITOR=$m polybar --reload example & | |
done | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;===================================================== | |
; | |
; To learn more about how to configure Polybar | |
; go to https://github.com/jaagr/polybar | |
; | |
; The README contains alot of information | |
; | |
;===================================================== | |
[colors] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Pipe, PipeTransform} from 'angular2/core'; | |
/* | |
* Changes the case of the first letter of a given number of words in a string. | |
*/ | |
@Pipe({name: 'titleCase', pure: false}) | |
export class TitleCase implements PipeTransform { | |
transform(input:string, length: number): string{ | |
return input.length > 0 ? input.replace(/\w\S*/g, (txt => txt[0].toUpperCase() + txt.substr(1).toLowerCase() )) : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Wait until the test condition is true or a timeout occurs. Useful for waiting | |
* on a server response or for a ui change (fadeIn, etc.) to occur. | |
* | |
* @param testFx javascript condition that evaluates to a boolean, | |
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | |
* as a callback function. | |
* @param onReady what to do when testFx condition is fulfilled, | |
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | |
* as a callback function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function do_something() { | |
alert('hi!'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function balanced(str){ | |
var opens = ['{','(','['], | |
closes = ['}',')',']'], | |
split = str.split(''), | |
stack = []; | |
for (var i = 0; i < split.length - 1; i++){ | |
if (opens.indexOf(split[i]) >= 0){ | |
stack.push(split[i]); | |
} else if (closes.indexOf(split[i]) >= 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 'promises' can be thought of as an array of eventual values, and | |
* calling '.then()' of any one of those values would allow us to execute some event once the value | |
* has been fulfilled, i.e. once our AJAX call has provided us with a response. | |
* | |
* By calling 'apply()' on '$.when', we can call 'then()' for all members of promises, meaning we | |
* can wait until each call has been completed and a value has been returned. | |
*/ | |
var promises = [ | |
$.ajax('http://api.endpoint.com?type=data1'), |
NewerOlder