Skip to content

Instantly share code, notes, and snippets.

View tarex's full-sized avatar
🎯
Focusing

Tareq Jobayere tarex

🎯
Focusing
View GitHub Profile
@clouddueling
clouddueling / console.log
Created January 4, 2014 05:59
My only take away from Paul Irish's talk on workflow. Run this in your Chrome console. :)
console.log('%c I AM UNICORN!!!', 'color: #fff; font-size: 30px; font-family: Verdana; text-shadow: 0px 2px 3px #555; padding: 20px 400px; width: 100%; background: #F66 url(rainbow-gradient.jpg); background-image: -moz-linear-gradient( left top, right bottom , from(red), color-stop(16%, orange), color-stop(32%, yellow), color-stop(48%, green), color-stop(60%, blue), color-stop(76%, indigo), to(violet)); /*webkit rainbow gradient*/ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.00, red), color-stop(16%, orange), color-stop(32%, yellow), color-stop(48%, green), color-stop(60%, blue), color-stop(76%, indigo), color-stop(1.00, violet));}');
/**
* Filter to check for CSRF attacks from the ajax requests.
*/
Route::filter('csrf_header', function()
{
if (Session::token() != Request::header('x-csrf-token'))
{
throw new Illuminate\Session\TokenMismatchException;
}
});
@zaherg
zaherg / install.md
Last active October 18, 2020 17:45
a small tips to install latest nginx , php 5.5 & laravel 4.1 since that Laravel 4.1 has been released, i have removed the line which explain how to install laravel from dev branch using composer.

Creating Your Laravel & nginx Server

We will install Larave 4.1 with PHP5.5 & Latest nginx on Ubuntu 12.04.3 x64.

updating your system

apt-get update && apt-get upgrade
adduser [username]
usermod -aG sudo [username]
apt-get -y install git
@hissy
hissy / nav-menu-exporter-importer.php
Last active August 13, 2023 17:06
[WordPress Plugin] Nav Menu Exporter and Importer / Export and Import nav menus. Requires WordPress Importer plugin.
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
@clouddueling
clouddueling / MainCtrl.js
Last active November 3, 2022 13:26
How to authenticate using AngularJS
controllers.controller('MainCtrl', function($scope, $location, Facebook, $rootScope, $http, $location, Upload, Auth, User, Question, Category, Serie, Record, Location, Popup, Process, Card, Question) {
$scope.$on('authLoaded', function() {
$scope.isExpert($scope.main.serieId);
$scope.isMember($scope.main.serieId);
});
$scope.loadAuth = function() {
Auth.load().success(function(data) {
$scope.main.user = data.user;
$scope.$broadcast("authLoaded");
@JeffreyWay
JeffreyWay / gist:6176883
Created August 7, 2013 18:19
Add this to your bash_profile. Now, whenever you need to fetch your ssh-key, just type sshkey, and it'll be copied to your clipboard.
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
@sarim
sarim / README.md
Last active February 5, 2020 20:01
Gittu Smart Path Prompt for Bash

##What is it ? Many of us like to see pwd in bash prompt. However if we travel too deep inside directory trees, the path becomes very lengthy and almost eats all the space. So its good to only show last part of the path. That what this script does.

Before:

Before

After:

After

@joseph-turner
joseph-turner / flexbox-mixin.scss
Created May 29, 2013 22:21
Flexbox SASS mixin (Compass required) Implementation based on Chris Coyier's article: Using Flexbox: Mixing Old and New for the Best Browser Support (http://css-tricks.com/using-flexbox/)
// ==================================================================
// Flexbox
//
// Implementation based on Chris Coyier's article:
// Using Flexbox: Mixing Old and New for the Best Browser Support || http://css-tricks.com/using-flexbox/
// ==================================================================
// Flexbox Context (applied to container element of flex items)
@mixin flex-display {
@include experimental-value(display, box, -moz, -webkit, not -o, -ms, not -khtml, official); // Old
@maxkandler
maxkandler / gist:5233150
Created March 24, 2013 19:25
Hide the iTerm2 Dock icon.
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist
@melissacabral
melissacabral / wp-dimox-breadcrumbs.php
Last active February 17, 2022 09:13
breadcrumbs - place in functions.php and call in your theme with dimox_breadcrumbs() [Source](http://dimox.net/wordpress-breadcrumbs-without-a-plugin/)
<?php
/**
* Dimox Breadcrumbs
* http://dimox.net/wordpress-breadcrumbs-without-a-plugin/
* Since ver 1.0
* Add this to any template file by calling dimox_breadcrumbs()
* Changes: MC added taxonomy support
*/
function dimox_breadcrumbs(){
/* === OPTIONS === */