Skip to content

Instantly share code, notes, and snippets.

View ostronom's full-sized avatar

Konstantin Kirillov ostronom

View GitHub Profile
@gaga5lala
gaga5lala / restore_docker_image_tag.sh
Created November 7, 2017 02:04
Restore docker image tag from text file.
# 1. Backup image tags to text file.
# $ docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" > img_id.txt
#
# 2. Execute clean-docker-for-mac script
# $ bash clean-docker-for-mac.sh $(docker images --format "{{.ID}}" | xargs)
#
# source: https://gist.github.com/MrTrustor/e690ba75cefe844086f5e7da909b35ce#file-clean-docker-for-mac-sh
#
# 3. Execute this script to restore tags from text file.
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 3, 2024 12:32
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@codahale
codahale / pom.xml
Last active April 20, 2024 01:38
Take this and save it as pom.xml in your project directory.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- none yet -->
@m0smith
m0smith / hibernate-clojure.clj
Created September 28, 2011 12:52
Proof of concept of using clojure and hibernate
(ns topoged.model.type
(:import
(javax.persistence Entity Id Column Table GeneratedValue)
))
(definterface IType (getId []))
(deftype
^{Entity {} Table {:name="TYPE"} org.hibernate.annotations.Entity {:mutable false}}
TypeX [^Long id]
@erichocean
erichocean / gist:997630
Created May 29, 2011 10:20
improved SC.TemplateView
SC.mixin(SC.TemplateView.prototype,
/** @scope SC.TemplateView.prototype */{
templateNameDidChange: function() {
SC.Logger.debug("Template name was set to " + this.get('templateName'));
this.rerender();
}.observes('template'),
/**
Called when the template property associated with this view changes.
@stefri
stefri / template_changing_view.js
Created May 28, 2011 15:44
SC.TemplateChangingView
SC.TemplateChangingView = SC.TemplateView.extend(
/** @scope SC.TemplateChangingView.prototype */{
templateNameDidChange: function() {
SC.Logger.debug("Template name was set to " + this.get('templateName'));
this.rerender();
}.observes('template'),
/**
Called when the template property associated with this view changes.
@nandub
nandub / ProtobufEnvelope.java
Created May 1, 2011 05:52
ProtobufEnvelope - allows creating a protobuf message without the .proto file dynamically.
import com.google.protobuf.DescriptorProtos;
import com.google.protobuf.Descriptors;
import com.google.protobuf.DynamicMessage;
import com.google.protobuf.Message;
import java.util.HashMap;
/**
* ProtobufEnvelope - allows creating a protobuf message without the .proto file dynamically.
*
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(
@ghoseb
ghoseb / ns-cheatsheet.clj
Last active April 11, 2024 05:28 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.