Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I'm hiring! https://firemind.io/careers

Ahmed Nuaman ahmednuaman

💭
I'm hiring! https://firemind.io/careers
View GitHub Profile
@ahmednuaman
ahmednuaman / error.txt
Created Feb 11, 2013
PHP crypto error read out
View error.txt
<br />
<font size='1'><table class='xdebug-error xe-warning' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Warning: file_get_contents() [&lt;a href='function.file-get-contents'&gt;function.file-get-contents&lt;/a&gt;]: SSL: crypto enabling timeout in file.php on line <i>32</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0051</td><td bgcolor='#eeeeec' align='right'>647480</td><td bgcolor='#eeeeec'>{main}( )</td><td title='file.php' bgcolor='#eeeeec'>../file.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' a
@ahmednuaman
ahmednuaman / animateCSS.js
Created Dec 7, 2011
jQuery plugin to dynamically apply animate.css animations
View animateCSS.js
(function ($) {
$.fn.animateCSS = function (effect, delay, callback) {
// Return this to maintain chainability
return this.each(function () {
// Cache $(this) for speed
var $this = $(this);
@ahmednuaman
ahmednuaman / wordpress-multisite-lighttpd.conf
Created Dec 12, 2010
A nice little rewrite directive for WordPress Multi-site and Lighttpd
View wordpress-multisite-lighttpd.conf
url.rewrite-once = (
"^/(.*/)?files/$" => "/index.php",
"^/(.*/)?files/(.*)" => "/wp-content/blogs.php?file=$2",
"^(/wp-admin/.*)" => "$1",
"^/([_0-9a-zA-Z-]+/)?(wp-.*)" => "/$2",
"^/([_0-9a-zA-Z-]+/)?(.*\.php)" => "/$2",
"^/(.*)/?$" => "/index.php"
)
@ahmednuaman
ahmednuaman / update-wordpress.sh
Created Dec 1, 2010
A simple bash script to update Wordpress
View update-wordpress.sh
#!/bin/bash
# This work is licenced under the Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License.
# To view a copy of this licence, visit http://creativecommons.org/licenses/by-sa/2.0/uk/ or send a letter
# to Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.
# So before you start, the script assumes the following:
# 1. you have some sort of SSH access
# 2. you are owner of your blog (in terms of computa permissions)
# 3. the blog folder is called 'blog' (if not, change all instances of the word 'blog' with whatever it's called)
@ahmednuaman
ahmednuaman / remove-v-from-git-tags.sh
Created Jun 25, 2014
Remove the v from git tags
View remove-v-from-git-tags.sh
for tag in $(git tag)
do
git tag "${tag/v/}" $tag
done
for tag in $(git tag)
do
if [[ $tag = *v* ]]
then
git tag -d $tag
@ahmednuaman
ahmednuaman / subl3.json
Last active Aug 30, 2017
Sublimetext 3 prefs
View subl3.json
{
"auto_complete": true,
"binary_file_patterns":
[
".nyc_*",
"dist/*",
"node_modules/*",
"bower_components/*",
"build/*",
"report/*",
@ahmednuaman
ahmednuaman / dynamo-import.js
Created May 17, 2017
Serverless-dynamodb-local migration to AWS script
View dynamo-import.js
const { basename, join } = require('path')
const { DynamoDB } = require('aws-sdk')
const { readFileSync } = require('fs')
const glob = require('glob')
const doc = new DynamoDB.DocumentClient({
region: 'eu-west-2'
})
glob(join(process.cwd(), 'seed/db/*.json'), (error, files) => {
View Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/vivid64"
config.vm.network "forwarded_port", guest: 80, host: 8000
config.vm.synced_folder ".", "/var/www/html"
config.ssh.forward_agent = true
config.vm.provision "shell", inline: <<-SHELL
export DEBIAN_FRONTEND=noninteractive
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
View .zshrc
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="muse"
alias zshconfig="st $HOME/.zshrc"
COMPLETION_WAITING_DOTS="true"
plugins=(git git-extras osx sublime)
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:$PATH
export PATH=$HOME/.macports/bin:$HOME/.macports/sbin:$PATH
View app-controller.coffee
define [
'controller/base-controller'
], (BCtrl) ->
class AppController extends BCtrl
@register 'appController', [
'$scope',
'$location'
]
# or (but then big inject deps could get long)