Skip to content

Instantly share code, notes, and snippets.

View dervondenbergen's full-sized avatar
🍕

Felix De Montis dervondenbergen

🍕
View GitHub Profile
@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

(function($){
var insertAtCaret = function(value) {
if (document.selection) { // IE
this.focus();
sel = document.selection.createRange();
sel.text = value;
this.focus();
}
else if (this.selectionStart || this.selectionStart == '0') {
var startPos = this.selectionStart;
@sdvg
sdvg / inwx-pricesorter.user.js
Created August 26, 2012 18:28
INWX.de Domain-"price sorter"
// ==UserScript==
// @name inwx.de price-sorter
// @namespace inwx.de-price-sorter-SD12
// @version 0.1
// @description appends buttons to the domain list to sort the list after prices
// @match http://www.inwx.de/de/domain/*
// @copyright 2012+, Stefan Dietz <dev@stefan-dietz.eu>
// ==/UserScript==
var appendControls = function() {
@nnnnathann
nnnnathann / gist:3491640
Created August 27, 2012 19:37
Reverse HTTP Proxy (Apache + nodejs)
We couldn’t find that file to show.
@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@19h
19h / reset.js
Created February 19, 2013 22:51
Node.js — Clear Terminal / Console. Reset to initial state.
console.reset = function () {
return process.stdout.write('\033c');
}
@martinwinter
martinwinter / Open Safari tabs in Google Chrome
Last active November 20, 2020 11:33
Opens all Safari windows and tabs in Google Chrome.
tell application "Safari"
repeat with theSafariWindow in windows
tell application "Google Chrome" to set theChromeWindow to make new window
repeat with theSafariTab in theSafariWindow's tabs
set theURL to URL of theSafariTab
tell application "Google Chrome"
set theChromeTab to make new tab at end of tabs of theChromeWindow
set URL of theChromeTab to theURL
end tell
end repeat
@KevinGimbel
KevinGimbel / loop.html
Created January 3, 2014 21:35
Building a Portfolio Page with Jekyll and Posts. Not tested but should work.
<!-- the standard loop for all your posts -->
{% for post in site.posts %}
<!-- check if there is a portfolio thing set inside the Front Matter
Note: Do not set "portfolio: false" on normal posts - this is not needed
and could lead to problems
-->
{% if post.portfolio %}
<!-- do nothing here -->
{% endif %}
@KevinGimbel
KevinGimbel / hosts
Created February 17, 2014 20:14
Basics of setting up a VirtualHost with Apache (locally)
# /etc/hosts
127.0.0.1 localhost
127.8.8.8 fuckyouverymu.ch
127.0.0.8 atariba.se
127.0.0.3 typo3.local
127.0.0.5 my-awesome-site.local
# In my browser I can now use http://fuckyouverymu.ch to see my localhost (because I have no site.conf for fuckyouverymu.ch at the moment :D)
@toddmotto
toddmotto / consoleLoge.js
Last active August 29, 2015 13:57
console.loge(), many log, much console
window.console.loge = function (msg) {
var gifs = ['wink','shake-space','peepers','prizza','hat','gradient','fat','rainbow','sunglasses','derp','shake'],
wow = ['', 'wow! ', 'amaze! ', 'dazzle! '],
adjs = ['so', 'such', 'many', 'much', 'very'],
randomizr = function (a) { return a[Math.floor(Math.random() * a.length)];},
message = '%c ' + randomizr(wow) + randomizr(adjs) + ' ' + typeof msg + ': ',
css = 'background: url(http://d1e3ezyatlol8u.cloudfront.net/img/212/doge-' + randomizr(gifs) + '-212.gif) no-repeat 0 0; background-size: 80px 80px; font-family: \'Comic Sans MS\', cursive; text-shadow: 0 1px 1px rgba(0,0,0,1); font-size: 14px; padding: 25px; line-height: 70px; color: #fff; font-weight: 100;';
console.log.apply(console, typeof msg === 'object' ? [message, css, msg] : [message += msg, css]);
};