Skip to content

Instantly share code, notes, and snippets.

View xhezairbey's full-sized avatar

Arian Xhezairi xhezairbey

View GitHub Profile
@xhezairbey
xhezairbey / bitly_api_v3_shorten.php
Created October 27, 2011 23:42
BitLy API v3 Shorten PHP
<?php
function bitly_shorten($url) {
$login = "bitly_login";
$apikey = "bitly_apikey";
$format = "json";
$query = array("login" => $login,
"apiKey" => $apikey,
"longUrl" => urlencode($url),
"format" => $format);
@xhezairbey
xhezairbey / sidebar.twig
Created December 20, 2011 12:44
Chyrp Drop-down Archive List
{% if theme.archives_list %}
<h4>${ "ARCHIVE" | translate }</h4>
<br />
<select name="archive" id="archive" onchange="location = this.options[this.selectedIndex].value;">
{% for archive in theme.archives_list %}
<option value="$archive.url">${ archive.when | strftime("%B %Y" | translate) } ($archive.count)</option>
{% endfor %}
</select>
<p><a href="{% url "archive" %}">${ "All &rarr;" | translate }</a></p>
{% endif %}
@xhezairbey
xhezairbey / gist:3740944
Created September 18, 2012 02:36 — forked from czottmann/gist:2490462
The Unfollow Manifesto

At some point in the past, I've decided to follow you on Twitter or any other social network, because you appeared to be a person whose postings I might be interested in.

But recently you noticed me unfollowing you.

Now you're confused/sad/angry. Don't be. Because here are the three simple rules I adhere to.

  1. You may unfollow me at any given time, because what I post might not be your cup of tea. It's okay, no hard feelings. I won't take that as an insult. (Really.) I assume we're still cool outside said service, unless of course I wrote some horrible shit that offended you, in which case I am probably sorry.
@xhezairbey
xhezairbey / Seitwert.php
Created December 10, 2012 15:55
A simple class to retrieve Seitwert.de results
<?php
class Seitwert {
private $key;
private $api;
function __construct() {
$this->key = "yourseitwertkeyhere";
$this->api = "http://www.seitwert.de/api/getseitwert.php?";
}
//
// UACellBackgroundView.m
// Ambiance
//
// Created by Matt Coneybeare on 1/31/10.
// Copyright 2010 Urban Apps LLC. All rights reserved.
//
#define TABLE_CELL_BACKGROUND { 1, 1, 1, 1, 0.866, 0.866, 0.866, 1} // #FFFFFF and #DDDDDD
#define kDefaultMargin 10

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@xhezairbey
xhezairbey / color.m
Created October 25, 2013 13:41 — forked from kylefox/color.m
/*
Distributed under The MIT License:
http://opensource.org/licenses/mit-license.php
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 copies of the Software, and to
@xhezairbey
xhezairbey / delete.blade.php
Last active December 28, 2015 19:29
Laravel Starter Site Fix Delete Post
@extends('admin.layouts.modal')
{{-- Content --}}
@section('content')
<!-- Tabs -->
<ul class="nav nav-tabs">
<li class="active"><a href="#tab-general" data-toggle="tab">General</a></li>
</ul>
<!-- ./ tabs -->
<?php
### --- Snip --- ###
App::after(function($request, $response)
{
// HTML Minification
if(App::Environment() != 'local')
{
if($response instanceof Illuminate\Http\Response)

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post