Skip to content

Instantly share code, notes, and snippets.

View wellic's full-sized avatar

Valerii Savchenko wellic

View GitHub Profile
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
struct {
char buffer[1024];
@wellic
wellic / checkCDNloaded.js
Created February 16, 2015 11:16
Correct loaded js-lib from CDN
<script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
<!-- Check loaded lib -->
<script>
!window.jQuery && document.write('<script src="js/jquery.js"></script>')
</script>
@wellic
wellic / git_push_for_2_servers
Created February 16, 2015 11:55
Git push for 2 servers
# rename origin remote
git remote rename origin server1name
# add the gitlab remote (for the love of everything that’s holy, use ssh)
git remote add server2name <remote link for server2>
# push existing code to new remote
git push -u server2name —all
@wellic
wellic / .gitconfig
Last active August 29, 2015 14:16 — forked from robmiller/.gitconfig
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@wellic
wellic / sync.sh
Created March 19, 2015 08:18
small rsync tools
#!/usr/bin/env bash
set -e
DEBUG=1
DST=your_destination_path
SRC=$(dirname "$0")
declare -a EXCLUDE=(
/.git/
/web/assets/*
@wellic
wellic / ubuntu-php-development-environment.md
Last active August 29, 2015 14:26 — forked from DaRaFF/ubuntu-php-development-environment.md
Ubuntu php development environment

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

@wellic
wellic / post.md
Last active August 29, 2015 14:26 — forked from kbond/post.md
Ubuntu LAMP Development Environment Setup

Install git:

sudo apt-get install git

Configure Git:

touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"

git config --global user.email "Your Email"

@wellic
wellic / skype_start.sh
Created November 10, 2015 13:18
Skype video is flipped
#!/bin/bash
#http://askubuntu.com/questions/462547/webcam-flipped-aka-v4l1compat-so-troubles
#sudo apt-get install libv4l-dev
killall skype
sleep 3
bash -c 'LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so skype'
@wellic
wellic / mvvm.html
Created February 18, 2016 06:47 — forked from smelukov/mvvm.html
Very simple MVVM (dynamic data binding) on JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>MVVM</h1>
@wellic
wellic / test_array.php
Last active February 19, 2016 10:31
Test merge array php
<?php
$a = array('a' => array('b' => 1, 'c'=>1, 'd' => 1));
$b = array('a' => array('b' => 2, 'c'=>2, 'e' => 2));
$c1 = $a + $b;
$c2 = array_merge($a,$b);
$c3 = array_merge_recursive($a,$b);
$d2 = array_replace($a,$b);
$d3 = array_replace_recursive($a,$b);