Skip to content

Instantly share code, notes, and snippets.

View cawa87's full-sized avatar
🤡
bip bip

Aleksandr Zamiatin cawa87

🤡
bip bip
View GitHub Profile
@robertmarsal
robertmarsal / gist:9feaa9150926efa4175a
Created December 17, 2014 21:09
Install f.lux on Ubuntu 14.10
sudo apt-get install python-glade2 python-appindicator
git clone https://github.com/Kilian/f.lux-indicator-applet.git
cd f.lux-indicator-applet
chmod +x setup.py
sudo ./setup.py install
fluxgui
@tamoyal
tamoyal / gist:10441108
Created April 11, 2014 04:39
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@leon
leon / copy-value.js
Created March 20, 2013 14:43
Angular Copy values from form
.directive('copyValue', function($parse) {
return function(scope, element, attrs) {
if (attrs.ngModel) {
if (element[0].type === "radio") {
if (element[0].checked === true) {
$parse(attrs.ngModel).assign(scope, element.val());
}
} else {
$parse(attrs.ngModel).assign(scope, element.val());
}
@fennb
fennb / gist:1283573
Created October 13, 2011 06:35
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)
<?php
namespace Turtle\ApiBundle\Serializer\Normalizer;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer,
Symfony\Component\Serializer\SerializerInterface;
class DateTimeNormalizer extends AbstractNormalizer
{
/**