Skip to content

Instantly share code, notes, and snippets.

@ArtemGordinsky
ArtemGordinsky / node-npm-in-docker.sh
Created Dec 11, 2015
Run Node/NPM in a Docker container
View node-npm-in-docker.sh
# For example, run "npm install"
docker run -v "$PWD":/usr/src/app -w /usr/src/app node:4 npm install
# This command creates a container (downloading one first if you don't have it locally), runs the command in a current directory and quits the container
# Great Success!
@noisebleed
noisebleed / ghost-upgrade.py
Created Dec 11, 2014
Ghost upgrade script (Python)
View ghost-upgrade.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Vítor Brandão <vitor@noiselabs.org>
import subprocess
from contextlib import closing
import glob
import os
import requests
@noisebleed
noisebleed / overlay.py
Created Jul 28, 2012
Portage API - Return all packages available in given Overlay [Gentoo Linux]
View overlay.py
import portage
from gentoolkit.package import Package
def get_all_packages(overlay_path):
"""Returns all packages from a given overlay path.
"""
packages = {}
porttree = portage.db[portage.root]['porttree']
vartree = portage.db[portage.root]['vartree']
@Ocramius
Ocramius / User.php
Last active Apr 23, 2019
Doctrine 2 ManyToMany - the correct way
View User.php
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
You can’t perform that action at this time.