Skip to content

Instantly share code, notes, and snippets.

Ahmed Nuaman ahmednuaman

Block or report user

Report or block ahmednuaman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 gist:dbce973963dcccc88dde
Verifying that +ahmednuaman is my blockchain ID. https://onename.com/ahmednuaman
@ahmednuaman
ahmednuaman / Dockerfile
Created Oct 16, 2015
Magento Dockerfile
View Dockerfile
FROM octohost/base:trusty
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys C300EE8C; \
echo 'deb http://ppa.launchpad.net/nginx/stable/ubuntu trusty main' > /etc/apt/sources.list.d/nginx-stable-trusty.list; \
apt-get update; \
apt-get install -y nginx git
ADD /tmp-conf/default /etc/nginx/sites-available/default
ADD /tmp-conf/nginx.conf /etc/nginx/nginx.conf
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 msgpack-javascript.js
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
@ahmednuaman
ahmednuaman / gist:6156cad582db96a9099e
Created Apr 11, 2015
Cannot resolve module 'istanbul-instrumenter-loader'
View gist:6156cad582db96a9099e
var cwd = process.cwd(),
path = require('path');
module.exports = function (config) {
config.set({
basePath: cwd,
browsers: [
'Chrome'
],
files: [
@ahmednuaman
ahmednuaman / default.js
Created Jan 6, 2015
Getting BrowserSync and gulp-watch to play nicely
View default.js
var browserSync = require('browser-sync'),
common = require('./__common__'),
gulp = require('gulp'),
watch = require('gulp-watch');
gulp.task('default', [
'less'
], function () {
browserSync({
server: {
@ahmednuaman
ahmednuaman / grunt-githash.js
Created Dec 12, 2014
Grunt githash grabber
View grunt-githash.js
// use like <%= commitsha1 %>
grunt.registerTask('githash', function () {
var done = this.async(),
config;
config = {
cmd: 'git',
args: ['rev-parse', '--verify', 'HEAD']
};
@ahmednuaman
ahmednuaman / parse.py
Created Oct 3, 2014
A simple example of how to parse a page with python
View parse.py
import urllib2
from bs4 import BeautifulSoup
page = urllib2.urlopen('http://www.bbc.co.uk/sport/football/tables')
soup = BeautifulSoup(page)
rows = soup.find_all('tr')
for row in rows:
team = row.find('td', class_='team-name')
@ahmednuaman
ahmednuaman / foo-directive-partial.html
Created Sep 22, 2014
The difference between @, =, and & in AngularJS directives
View foo-directive-partial.html
<div class="foo">
<ul>
<li data-ng-repeat="item in items">{{item}}</li>
</ul>
</div>
You can’t perform that action at this time.