This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
angular.module('myApp').directive( | |
'ngToggle', | |
function() { | |
var factory = { | |
restrict: 'A', | |
link: function postLink(scope, element, attributes) { | |
$(element).on('click', function(event) { | |
event.preventDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
angular.module('myApp').directive( | |
'ngSelectOnFocus', | |
function() { | |
var factory = { | |
restrict: 'A', | |
link: function postLink(scope, element) { | |
$(element).focus(function(event) { | |
event.target.select(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en" ng-app="myApp"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Dynamic Pagination w/ Filtering</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content="Kim Maida"> | |
<!-- JS Libraries --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Cleaning up any existing phar | |
if(file_exists('package.phar')) | |
{ | |
unlink('package.phar'); | |
} | |
//Where are my application sources | |
$dir = '../app/'; | |
//Quickly get a recursive folder list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path = ".." | |
rootpath = File.expand_path(".") | |
realpath = File.expand_path(rootpath + "/" + path) | |
if realpath == rootpath or realpath.index(rootpath).nil? | |
puts "You went too far up" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd = 'ls' | |
stdin, stdout, stderr = Open3.popen3(cmd) | |
stdout = stdout.readlines.to_s | |
stderr = stderr.readlines.to_s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# External USB drives eject tool. | |
# You should install growlnotify to get notifications from http://growl.info/extras.php#growlnotify | |
# It will eject all USB disks and all mounted images. It will warn you with a red icon if something goes wrong | |
# It starts from the bottom to the top to tentavily eject the mounted images before the drive they could be on. | |
# | |
# Advices: | |
# - Use Automator to make this script an app | |
# - Install Better Touch Tool (http://www.boastr.de/) to give it a global shortcut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Project+: http://ciaranwal.sh/projectplus | |
mkdir -p ~/Library/Application\ Support/TextMate/Bundles | |
cd !$ | |
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/ | |
osascript -e 'tell app "TextMate" to reload bundles' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server | |
{ | |
listen 80; | |
server_name website.loc www.website.loc; | |
access_log /var/log/nginx/website.access_log; | |
error_log /var/log/nginx/website.error_log; | |
root /var/www/website.loc/web/; | |
index index.php; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is an helper class to quickly create anonymous classes | |
* Usage: | |
* $shellWrapper = new Anonymous(); | |
* $shellWrapper->exec = function($command) use($shellWrapper) | |
* { | |
* return exec($command); | |
* }; | |
* $shellWrapper->exec('ls -la .'); |
OlderNewer