Skip to content

Instantly share code, notes, and snippets.

View JanJastrow's full-sized avatar

Jan Jastrow JanJastrow

View GitHub Profile
activate application "SystemUIServer"
tell application "System Events"
tell process "SystemUIServer"
-- Working CONNECT Script. Goes through the following:
-- Clicks on Bluetooth Menu (OSX Top Menu Bar)
-- => Clicks on SX-991 Item
-- => Clicks on Connect Item
set btMenu to (menu bar item 1 of menu bar 1 whose description contains "bluetooth")
tell btMenu
click
@shubheksha
shubheksha / brackets-pair-colorizer.md
Last active May 1, 2023 18:05
A list of extensions/plugins that highlight matching parens/braces for various editors/IDEs.
@outcoldman
outcoldman / dbhist.sh
Created July 19, 2017 21:53
DBHist: bash history in sqlite
# The MIT License
# SPDX short identifier: MIT
# Further resources on the MIT License
# Copyright 2017 Denis Gladkikh (https://www.outcoldman.com/en/archive/2017/07/19/dbhist/)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// Background mixin
@mixin strips($color, $angle){
$color: saturate(lighten($color, 2%), 10%);
background: $color
linear-gradient($angle, $color 0%, $color 10%,
mix(black, $color, 5%) 10%, mix(black, $color, 5%) 20%,
mix(black, $color, 12%) 19%, mix(black, $color, 10%) 21%, // Thin line between gradient
mix(black, $color, 10%) 20%, mix(black, $color, 10%) 30%,
mix(black, $color, 17%) 29%, mix(black, $color, 15%) 31%, // Thin line between gradient
mix(black, $color, 15%) 30%, mix(black, $color, 15%) 40%,
@doersino
doersino / backup_tumblr.sh
Last active January 15, 2022 23:32
Simple way of backing up one or multiple Tumblr blogs to date-prefixed folders; downloads and removes required software (except Python) automatically. http://neondust.tumblr.com/post/97723922505/simple-tumblr-backup-script-for-mac-os-x-and-linux
#!/bin/bash
# http://neondust.tumblr.com/post/97723922505/simple-tumblr-backup-script-for-mac-os-x-and-linux
# https://gist.github.com/doersino/7e3e5db591e42bf543e1
# BLOGS is a space-separated list of the blogs you want to backup. You can omit
# the ".tumblr.com" part if you want.
BLOGS="neondust.tumblr.com aufgeloest.tumblr.com hejlisten.tumblr.com"
# OUT is the directory where the backups will be stored. For each blog, a date-
# prefixed subdirectory will be created here.
@AGWA
AGWA / rpi-hdmi.sh
Last active March 18, 2024 06:04
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
#!/bin/sh
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in
@scy
scy / README.md
Last active July 7, 2023 09:27
My OSX PF config for #30C3.

My OS X “VPN only” Setup For #30C3

You should never let passwords or private data be transmitted over an untrusted network (your neighbor’s, the one at Starbucks or the company) anyway, but on a hacker congress like the #30C3, this rule is almost vital.

Hackers get bored easily, and when they’re bored, they’re starting to look for things to play with. And a network with several thousand connected users is certainly an interesting thing to play with. Some of them might start intercepting the data on the network or do other nasty things with the packets that they can get.

If these packets are encrypted, messing with them is much harder (but not impossible! – see the end of this article). So you want your packets to be always encrypted. And the best way to do that is by using a VPN.

Target audience

@panzi
panzi / gist:7551381
Created November 19, 2013 19:49
Download currently playing HTML5 audio/video bookmarklet.
Create a new bookmark and set it's URL to this:
javascript:(function(xs)%7Bfor(var%20i%3D0%3Bi%3Cxs.length%3B%2B%2Bi)%7Bif(xs%5Bi%5D.currentSrc)%7Breturn%20window.open(xs%5Bi%5D.currentSrc)%3B%7D%7D%7D)(document.querySelectorAll('audio%2Cvideo'))%3B
When media is playing using HTML5 audio/video you can click this bookmark to open a new tab/window with the media. Then to download it use the context menu action "Save As..." (right mouse button -> Save As...).
If you use Chrome/Safari/recent Opera (WebKit/Blink) you can do better(!) and immediately download the file using this bookmarklet instead:
javascript:(function(xs)%7Bfor(var%20i%3D0%3Bi%3Cxs.length%3B%2B%2Bi)%7Bif(xs%5Bi%5D.currentSrc)%7Bvar%20a%3Ddocument.createElement('a')%3Ba.target%3D'_blank'%3Ba.download%3D''%3Ba.href%3Dxs%5Bi%5D.currentSrc%3Ba.click()%3Breturn%3B%7D%7D%7D)(document.querySelectorAll('audio%2Cvideo'))%3B
@davatron5000
davatron5000 / Sublime Text Setup.md
Last active April 15, 2023 15:39
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

@johan
johan / index.html
Created July 20, 2012 05:02
HTML5 GPS tracker
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML5 GPS</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="style.css">
</head>