Skip to content

Instantly share code, notes, and snippets.

View davispuh's full-sized avatar

Dāvis davispuh

  • Latvia
View GitHub Profile
@davispuh
davispuh / podfm.js
Created December 15, 2014 17:50
podfm
var loc = window.document.getElementsByName("embeddedPlayer");
if (loc.length > 0) {
window.location = loc[0].src;
} else {
var a = window.document.getElementsByTagName("audio");
if (a.length > 0) {
if (!a[0].src) {
document.getElementsByClassName("jp-play")[0].click();
setTimeout(function(){ document.getElementsByClassName("jp-pause")[0].click(); },800);
};
@davispuh
davispuh / steamapps.js
Last active August 29, 2015 14:16
Free Steam apps
javascript:void%20function(){if(null===location.href.match(/^https:\/\/store\.steampowered\.com\/account\/%3F$/))return%20void%20alert(%22Please%20run%20this%20on%20Steam's%20account%20page%20details:%20https://store.steampowered.com/account/%22);var%20e=[62498,57178,62424,40585,60790,21154,21014,62298,60902,62313,62310,62307,62304,62301,61313,61897,58348,58197,62217,21376,61401,62193,62175,61884,62149,59907,61465,62126,56458,57792,60195,61243,62117,62112,59732,60895,62076,61398,61395,59457,61989,48134,52718,39544,61322,61848,61826,61770,60481,60988,56844,61527,61338,61614,53615,60224,61584,61562,56322,61474,61458,61455,58247,59771,59768,59765,61449,21490,61375,61369,61366,56364,61240,61292,61289,61270,61264,59884,57366,61219,61166,61184,52302,61126,61123,60938,61074,61059,61056,61048,61045,61033,61030,61008,60999,60982,60721,60205,46876,58394,54416,60888,60873,60870,60823,60806,60796,60793,60764,60761,60758,60749,60746,60743,60711,60662,60702,60689,60681,60678,60667,45117,59145,58549,60566,60563,60555,60519,
@davispuh
davispuh / SmartAttackScript.js
Last active August 29, 2015 14:23
SmartAttackScript
javascript:var Settings={Mode:0,Times:[0,6,12,18],Range: 1,Include:{Scout:1},Troops:[{Ram:1,All:1},{Catapult:1,All:1},{Spear:1,Sword:1,Axe:1,Light:1,Heavy:1,All:0}],Limit:{},Keep:0,Coords:'469|513 472|509 476|535 558|505 562|506 566|505 568|504 568|510 568|512 570|504 570|505 571|506 403|543 404|524 407|500 410|501 413|549 413|550 414|543 414|544 415|546 431|529 433|521 433|526 438|517 440|523 443|527 444|521 451|528 452|525 453|532 454|521 454|522 458|518 460|515 472|527 472|528 475|537 475|539 477|537 478|541 479|541 480|526 480|538 480|542 481|539 482|522 484|519 484|538 486|513 486|530 488|526 490|525 493|511 494|523 526|502 529|500 536|537 537|512 537|536 537|537 538|536 539|539 541|538 562|504 564|501 566|501 569|501 571|504 592|523 593|520 593|525 594|522 595|511 596|519 596|525 596|527 597|524 461|510 463|516 465|517 465|520 466|517 466|519 485|538 487|534 487|536 492|527 492|528 492|529 493|527 494|521 496|516 497|521 499|518 499|520 499|521 499|522 500|520 500|521 500|522 509|514 513|516 513|517 514
@davispuh
davispuh / PKGBUILD.patch
Last active August 29, 2015 14:24
Pacaur PKGBUILD.patch
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -33,25 +33,25 @@ build() {
package() {
cd "$srcdir/$_gitname"
- mkdir -p $pkgdir/etc/xdg/pacaur
- install -D -m644 ./config $pkgdir/etc/xdg/pacaur/config
- mkdir -p $pkgdir/usr/bin
- install -D -m755 ./pacaur $pkgdir/usr/bin/pacaur
@davispuh
davispuh / PKGBUILD.patch
Created July 2, 2015 18:08
attica-git patch
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,21 +13,21 @@ source=('attica::git+git://anongit.kde.org/attica')
md5sums=('SKIP')
pkgver() {
- cd ${srcdir}/attica
+ cd "${srcdir}/attica"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
@davispuh
davispuh / switch-modules.sh
Last active May 16, 2022 10:47
Switch NVIDIA/nouveau modules
#!/bin/sh
unbind_vtconsoles()
{
for ((i = 0; i < 16; i++))
do
if [ -d "/sys/class/vtconsole/vtcon$i" ]; then
if [ `cat /sys/class/vtconsole/vtcon$i/name | grep -c "frame buffer"` -eq 1 ]; then
while [ `cat /sys/class/vtconsole/vtcon$i/bind` -ne 0 ]; do
@davispuh
davispuh / switch-nvidia.service
Last active August 29, 2015 14:27
Switch to NVIDIA module
[Unit]
Description=Nvidia Switch
DefaultDependencies=no
After=plymouth-quit.service plymouth-quit-wait.service
Before=display-manager.service
[Service]
ExecStart=/bin/switch-modules.sh nvidia
Type=oneshot
KillMode=none
@davispuh
davispuh / vlc.log
Last active October 10, 2015 02:20
VLC
execve("/usr/sbin/vlc", ["vlc"], [/* 21 vars */]) = 0
brk(0) = 0x246d000
open("/usr/lib/tls/x86_64/libdlfaker.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/x86_64", 0x7ffd43baaca0) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libdlfaker.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls", 0x7ffd43baaca0) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64/libdlfaker.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64", 0x7ffd43baaca0) = -1 ENOENT (No such file or directory)
open("/usr/lib/libdlfaker.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\7\0\0\0\0\0\0"..., 832) = 832
@davispuh
davispuh / vlc.map
Created October 10, 2015 02:35
VLC
0000000000400000 12K r-x-- vlc
0000000000602000 4K r---- vlc
0000000000603000 4K rw--- vlc
00000000017ed000 1720K rw--- [ anon ]
00007efcfff12000 3048K rw-s- [ shmid=0x3a18020 ]
00007efd00212000 44K r-x-- libnss_files-2.22.so
00007efd0021d000 2044K ----- libnss_files-2.22.so
00007efd0041c000 4K r---- libnss_files-2.22.so
00007efd0041d000 4K rw--- libnss_files-2.22.so
00007efd0041e000 24K rw--- [ anon ]
@davispuh
davispuh / test_daylight_savings.patch
Created January 26, 2016 01:13
Chronic test_daylight_savings
diff --git a/test/test_daylight_savings.rb b/test/test_daylight_savings.rb
index d6f303f..3dfdc26 100644
--- a/test/test_daylight_savings.rb
+++ b/test/test_daylight_savings.rb
@@ -9,110 +9,91 @@ class TestDaylightSavings < TestCase
def test_begin_past
# ambiguous - resolve to last night
- t = Chronic::RepeaterTime.new('900')
- t.start = @begin_daylight_savings