Skip to content

Instantly share code, notes, and snippets.

View sancau's full-sized avatar

Alexander Tatchin sancau

View GitHub Profile
@sancau
sancau / angular-form-blocks-cloning.html
Last active February 24, 2016 14:36 — forked from commercial-hippie/angular_test.html
AngularJS | Form blocks cloning by user request
<!DOCTYPE html>
<html ng-app="sasApp">
<head>
<title>AngularJS Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css">
@sancau
sancau / independent-css-scrolling.html
Last active February 24, 2016 14:37
HTML/CSS | A pure CSS implementation of an independent multi-column scrolling with inertia.
<!-- This snippet is originally presented by Ben Frain @benfrain -->
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>Independent CSS scrolling panels (with inertia)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
@sancau
sancau / angular-validation-example.html
Created February 18, 2016 18:36
AngularJS | Simple Validation Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AngularJS Validation</title>
<!-- Angular 1.4.9 CDN -->
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.js"></script>
<style>
@sancau
sancau / angular-jade-gulp-setup.js
Last active April 4, 2016 08:47
A gulp setup to use with AngularJS/Jade projects
/*
A gulp setup to use with AngularJS/Jade projects
TODO: Add "newer" support to the tasks
*/
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var coffee = require('gulp-coffee');
var templateCache = require('gulp-angular-templatecache');
class App extends App
constructor: ->
return [
'app.auth'
'app.account'
'app.dashboard'
]

some usefull docker stuff

One liner to stop / remove all of Docker containers:

docker stop $(docker ps -a -q)

docker rm $(docker ps -a -q)

move files from host to container and overwise

@sancau
sancau / redux-basics.js
Last active August 4, 2016 11:00
Basic redux actions handling with multiple reducers
import { applyMiddleware, combineReducers, createStore } from 'redux';
//////////////////////////////////////////////////////
const userReducer = (state={}, action) => {
switch (action.type) {
case 'CHANGE_NAME': {
return {...state, name: action.payload}
}
case 'CHANGE_AGE': {
@sancau
sancau / chrome.md
Created August 5, 2016 07:00
Disable CORS in Google Chrome

Disables CORS in Chrome

google-chrome --disable-web-security --user-data-dir=/home/sancau/temp (some directory)

You have to mount your folder on your VM.

First you need to install Guest Additions (although I already did this during the installation).

Start your VM Devices > Insert Guest Additions CD image... I had to manually mount the CD: sudo mount /dev/cdrom /media/cdrom Install the necessary packages: sudo apt-get install make gcc linux-headers-$(uname -r) Install the Guest Additions: sudo /media/cdrom/VBoxLinuxAdditions.run Now you can mount your share using:

@sancau
sancau / MongoDB.md
Last active October 14, 2016 12:01

Mongo dump

mongodump -d database name -o target directory