Skip to content

Instantly share code, notes, and snippets.

View g1ibby's full-sized avatar
🎯
Focusing

Sergey Varibrus g1ibby

🎯
Focusing
  • Worldwide
View GitHub Profile
@bubba-h57
bubba-h57 / Serializor.php
Created September 13, 2012 14:49
Doctrine 2 Entities Serialized to JSON
<?php
namespace H57\Util;
class Serializor {
/**
* Converts the Doctrine Entity into a JSON Representation
*
* @param object $object The Object (Typically a Doctrine Entity) to convert to an array
@dkleehammer
dkleehammer / app.js
Created July 31, 2013 22:08
Backbone/Marionette JS session handling example
define([
'marionette',
'router',
'controller',
'modules/auth',
'modules/vent',
'views/_layout'
], function(Marionette, Router, Controller, Auth, Vent, Layout){
var App = new Marionette.Application();
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@honkskillet
honkskillet / byte-sizetuts.md
Last active June 18, 2022 14:18
A series of golang tutorials with youtube videos.
<!DOCTYPE html>
<html>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-type'>
<title>AlloyEditor as React Module Example</title>
<link href="bower_components/alloyeditor/dist/alloy-editor/assets/alloy-editor-ocean-min.css" rel="stylesheet">
<style>
#main {
left: 100px;
@gaearon
gaearon / combining.js
Created June 3, 2015 18:03
Combining Stateless Stores
// ------------
// counterStore.js
// ------------
import {
INCREMENT_COUNTER,
DECREMENT_COUNTER
} from '../constants/ActionTypes';
const initialState = { counter: 0 };
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@dphaener
dphaener / networkLayer.js
Created January 13, 2016 18:58
A sample custom network layer for Relay
import Relay from 'react-relay'
import fetch from 'isomorphic-fetch'
export default class NetworkLayer {
constructor(auth, url = null) {
this.auth = auth
this.url = url || 'http://localhost:7000/queries'
}
get defaultHeaders() {
@g1ibby
g1ibby / README.md
Created February 2, 2016 16:36
Using local packages as composer dependencies

When implementing your project, the need for some module, library, service provider or something else will arise, and sometimes you’ll have to implement it yourself. So, how to do that? The solution to this problem is described here. I like this decision all but speed. Therefore, it was written this script that clones the local repository with the package into a folder of your project vendor.

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm