Skip to content

Instantly share code, notes, and snippets.

View mishudark's full-sized avatar
:octocat:
Rocking

mishudark mishudark

:octocat:
Rocking
View GitHub Profile
echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
@mishudark
mishudark / docker-compose.yml
Created January 24, 2017 05:11
Parse Server
version: '2.0'
services:
mongo:
image: jadsonlourenco/mongo-rocks
environment:
AUTH: "no"
DB_USER: "user"
DB_PASS: "pass"
DATABASE: "parse"
ports:
@mishudark
mishudark / humanize.go
Last active December 1, 2016 16:32
Humanize numbers in go
package main
import (
"fmt"
"regexp"
"strconv"
)
func Currency(ammount interface{}) (string, error) {
var ok bool
import java.io.*;
import java.net.*;
public class Proxy {
int local_port;
int destiny_port;
String destiny_url;
ServerSocket server;
app.service('imageService', function ($http, $q, $timeout) {
var options = {};
this.createThumb = function(img, width, height){
self = {};
options.thumbnailWidth = width;
options.thumbnailHeight = height;
self.resultD = $q.defer();
$timeout(function () { thumb(self, img) });
return self.resultD.promise;
};
@mishudark
mishudark / sed_img_replace
Last active August 29, 2015 14:10
replace src and href
sed 's|\([href|src]\)="\([^"]*\)"|\1="{% static '\''\2'\'' %}"|'
@mishudark
mishudark / indexer_elasticsearch
Created November 23, 2014 02:43
indexer autocomplete
curl -XPUT "http://127.0.0.1:9200/cronologias" -d '
{
"settings": {
"number_of_shards": 1,
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": 1,
"max_gram": 20
@mishudark
mishudark / python-dokku
Created September 16, 2014 00:00
source python
source /app/.profile.d/python.sh
@mishudark
mishudark / beego.patch
Last active August 29, 2015 14:06
Session support for beego
diff --git a/beego.go b/beego.go
index e648480..5ddedc7 100644
--- a/beego.go
+++ b/beego.go
@@ -352,7 +352,7 @@ func initBeforeHttpRun() {
}
}
- if SessionOn {
+ if SessionOn || UseSessions {
@mishudark
mishudark / iconv
Created July 27, 2014 02:00
convert to utf8
iconv -f ISO-8859-1 -t UTF-8 input > output