Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
That worked!

Dominik dommmel

💭
That worked!
View GitHub Profile
@dommmel
dommmel / Vagrantfile
Last active Sep 26, 2019
Vagrantfile for Ruby on Rails application development (rbenv, postgres, node.js)
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
set -e
set -x
cd
sudo apt-get update -y
sudo apt-get install \
@dommmel
dommmel / delicious_to_pinboard.rb
Last active Aug 29, 2015
import any delicious user's bookmarks into pinboard (limited to the last 100 bookmarks)
View delicious_to_pinboard.rb
require "pinboard"
require 'net/https'
require "uri"
require "json"
username = "pinboard_username"
password = "pinboard_password"
delicious_user = "delicious_username"
pinboard = Pinboard::Client.new(:username => username, :password => password)
@dommmel
dommmel / miner.rb
Created Jan 24, 2014
Stripe-CTF Level-1
View miner.rb
require 'digest/sha1'
@ctf_username = "user-8lmmcgvw"
def addToLedger
user_in_ledger = false
File.open("LEDGER.txt").each_line do |line|
if line.match(/^#{@ctf_username}:/)
user_in_ledger = true
end
@dommmel
dommmel / gravatar.coffee
Created Oct 17, 2013
Retrieve Gravatar indenticon for a given email address via javascript. You need to include a md5 library (like http://www.myersdaily.org/joseph/javascript/md5-text.html)
View gravatar.coffee
# get the url of an emails gravatar image
#
# default_image can either be an image url or one of the following: mm, identicon, monsterid, wavatar, retro, blank
# (See https://de.gravatar.com/site/implement/images/ for all options)
#
# Example usage:
# get_gravatar_image_url("example@example.com", 80, "retro")
get_gravatar_image_url = (hashed_email, size=80, default_image="mm", force_default=false) ->
size = (if (size >= 1 and size <= 2048) then size else 80)
View export_addressbook_to_snom.scpt
-- Addressbook to SNOM export
-- Be sure to open Contacts app before running this script
set resultText to ""
set currentLine to ""
set numPhones to 0
tell application id "com.apple.AddressBook"
set the clipboard to people's vcard
-- Find the maximum number of phone numbers
repeat with x from 1 to the count of people
@dommmel
dommmel / Info.plist
Created Oct 10, 2013
Dial tel:// and sip:// links on your snom phone
View Info.plist
<!-- add this to the dict node -->
<key>CFBundleIdentifier</key>
<string>com.apple.AppleScript.SnomDialer</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>SnomDialer</string>
<key>CFBundleURLSchemes</key>
@dommmel
dommmel / hide_adress_bar.js
Created Sep 13, 2013
Hide adress bar on iphone/android
View hide_adress_bar.js
// Hide adress bar on iphone/android
$(function() {
function hideURLbar() {
if (window.location.hash.indexOf('#') == -1) {
window.scrollTo(0, 1);
}
};
if (navigator.userAgent.indexOf('iPhone') != -1 || navigator.userAgent.indexOf('Android') != -1) {
addEventListener("load", function() {
setTimeout(hideURLbar, 0);
@dommmel
dommmel / jquery.smoothscroll.js
Created Jul 4, 2013
jQuery smooth scroll to anchor
View jquery.smoothscroll.js
// use it like this: <a class="scroll" href="#destination1">Destination 1</a>
// <section id="destination1">Lore ipsum</section>
$(".scroll").click(function(event){
event.preventDefault();
//calculate destination place
var dest=0;
if($(this.hash).offset().top > $(document).height()-$(window).height()){
dest=$(document).height()-$(window).height();
}else{
@dommmel
dommmel / anno-parse-plugin.js
Last active Dec 18, 2015
Annotorious Plugin for Parse.com. A simple storage connector plugin to the Parse REST interface.
View anno-parse-plugin.js
/**
* A simple storage connector plugin to the Parse REST interface.
*
* Note: the plugin requires jQuery to be linked into the host page.
*
* THIS PLUGIN IS FOR DEMO PURPOSES ONLY - DON'T USE IN A PRODUCTION
* ENVIRONMENT.
*/
@dommmel
dommmel / random_refresh.js
Created Jun 4, 2013
refresh page on random intervals
View random_refresh.js
function doSomething() {
open(location.href, 'refreshingWindow');
}
(function loop() {
var rand = Math.round(Math.random() * (10000)) + 1000;
setTimeout(function() {
doSomething();
loop();
}, rand);