Skip to content

Instantly share code, notes, and snippets.

View stefanzweifel's full-sized avatar
🎯
Focusing

Stefan Zweifel stefanzweifel

🎯
Focusing
View GitHub Profile
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@stefanzweifel
stefanzweifel / sublime-settings.json
Last active August 29, 2015 13:57
Personal Sublime Text settings file
{
"Seti_no_bar_undertabs": true,
"Seti_tabs_med": true,
"bold_folder_labels": true,
"caret_extra_width": 2,
"caret_style": "square",
"close_windows_when_empty": true,
"color_inactive_tabs": true,
"color_scheme": "Packages/User/base16-ocean.dark (SL).tmTheme",
"copy_with_empty_selection": false,
@stefanzweifel
stefanzweifel / Vagrant.yaml
Created March 23, 2014 12:54
The Vagrant file I use for local Laravel development, in connection with https://puphpet.com/.
require 'yaml'
dir = File.dirname(File.expand_path(__FILE__))
configValues = YAML.load_file("#{dir}/puphpet/config.yaml")
data = configValues['vagrantfile-local']
Vagrant.configure("2") do |config|
config.vm.box = "#{data['vm']['box']}"
config.vm.box_url = "#{data['vm']['box_url']}"
@stefanzweifel
stefanzweifel / firefox-fix.css
Created April 24, 2014 09:37
Fixes weird Firefox bug for select-inputs. Removes this XP-style arrow-button thing.
select {
-moz-appearance: none;
text-indent: 0.01px;
text-overflow: '';
}
@stefanzweifel
stefanzweifel / slack.php
Created May 8, 2014 13:26
Slack.com Webhook Integration (PHP) - Simple snippet which tells you, how to build your payload array.
<?php
//Options
$token = 'YOUR_TOKEN_HERE';
$domain = 'YOUR_SLACK_DOMAIN_GOES_HERE';
$channel = '#general';
$bot_name = 'Webhook';
$icon = ':alien:';
$message = 'Your message';
@stefanzweifel
stefanzweifel / index.html
Created June 18, 2014 07:06
Force iOS Numeral Keyboard
<input type="text" pattern="[0-9]*">
@stefanzweifel
stefanzweifel / date-pattern.html
Created July 22, 2014 06:43
HTML5 validation pattern
<input type="text" pattern="(0[1-9]|1[0-9]|2[0-9]|3[01]).(0[1-9]|1[012]).[0-9]{4}" name="date" placeholder="Enter a date in format dd.mm.yyyy">
@stefanzweifel
stefanzweifel / .htaccess
Created August 3, 2014 14:38
Restrict all traffic except your IP address and more with .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
# If the IP address does not match this one
RewriteCond %{REMOTE_ADDR} !^110.110\.110\.110$
# And they are not accessing a certain subdirectory
RewriteCond %{REQUEST_URI} !^/admin
# And they are not accessing the development domain
@stefanzweifel
stefanzweifel / keybase.md
Created October 2, 2014 19:39
keybase proof

Keybase proof

I hereby claim:

  • I am stefanzweifel on github.
  • I am stefanzweifel (https://keybase.io/stefanzweifel) on keybase.
  • I have a public key whose fingerprint is EC86 B9C2 9050 F5EE ED2D E436 6938 B063 A922 A13E

To claim this, I am signing this object:

@stefanzweifel
stefanzweifel / index.php
Last active April 3, 2020 07:07
Screeenly API Example
<?php
$payload = array(
'key' => 'YOUR-API-KEY',
'url' => 'https://www.youtube.com/'
'height' => 800, // Optional
'width' => 500 // Optional
);
$payload = json_encode($payload);