Skip to content

Instantly share code, notes, and snippets.

View Witti's full-sized avatar
😺

Daniel Wittberger Witti

😺
View GitHub Profile
@afiore
afiore / pagesnap
Created June 21, 2010 02:06
Save a webpage (and its linked assets) into a single HTML file.
#! /usr/bin/env php
<?php
/***
* PageSnap
*
* Script for archiving a HTML page (and associated media assets) into a single file.
*
* Requires:
*
@mtigas
mtigas / gist:952344
Last active April 3, 2024 07:57
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

require 'formula'
class Fetchmail < Formula
# note that the following url is actually a javascript redirection.
# download the associated file and place it into /Library/Caches/Homebrew
homepage 'http://www.fetchmail.info/'
url 'http://prdownload.berlios.de/fetchmail/fetchmail-6.3.21.tar.bz2'
# md5 '548f152df27d32b632afa4f1a8a6cd1a'
md5 '0ad8eac47e85bd0ae63870daa09992af'
@zhouming
zhouming / MY_Session.php
Created September 8, 2012 05:51
Use redis in Codeigniter Session.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Session extends CI_Session{
private $sess_use_redis = TRUE;
private $redis = '';
public function __construct($params = array()) {
//parent::__construct();
$this->CI =& get_instance();
@JeffreyWay
JeffreyWay / snippet.xml
Created September 13, 2012 20:23
Laravel Resource - Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
@sineld
sineld / laravel-upload-resize.php
Created September 25, 2012 08:11
Laravel File Upload And Resize
<?php
// Resizer and Image Manipulation
// Based on: http://forums.laravel.com/viewtopic.php?id=2648
public function post_edit_logo($id)
{
$rules = array(
'image' => 'image',
);
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@jedda
jedda / gist:4103604
Created November 18, 2012 04:44
Configuring basic RADIUS on OS X 10.8 Server
# Configuring basic RADIUS on OS X 10.8 Server
# Jedda Wignall
# http://jedda.me
# Full writeup at: http://jedda.me/2012/11/configuring-basic-radius-os-108-server/
# create the SACL for access to RADIUS
dseditgroup -q -o create -u <admin user> -n . com.apple.access_radius
# configure radiusd to log both successful and failed authentications
desc "Create a new version tag and push a new podspec"
task :release do
require 'cocoapods'
require 'colored'
version = Pod::Specification.from_file(Pathname.pwd + 'MyLib.podspec').version
puts "Releasing version `#{version}'. Is that correct? (y/n)"
if $stdin.gets.strip.downcase == 'y'
sh "git tag -a #{version} -m 'Release #{version}'"
sh "git push --tags"
sh "pod lint"
@JeffreyWay
JeffreyWay / migration.php
Last active April 28, 2016 06:19
What else would you want on a typical pivot table...say for posts and tags.
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class PivotPostTagTable extends Migration {
/**
* Run the migrations.
*