Skip to content

Instantly share code, notes, and snippets.

@pupadupa
pupadupa / gist:c79ac1bb27c85310b646
Created December 6, 2015 09:43 — forked from tabacitu/gist:dbcfd71375e72c857474
Tabacitu Laravel Package Service Provider boilerplate code
<?php
namespace League\Skeleton;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
class SkeletonServiceProvider extends ServiceProvider
{
/**
@pupadupa
pupadupa / machine-learning-basics.py
Last active March 13, 2018 03:34
Some machine learning algorithm for Titanic dataset. SVM, Random Forest, XGBoost. Link to kaggle https://www.kaggle.com/c/titanic
# Be sure that you have installed libraries (if not - google it):
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import xgboost as xgb
from sklearn.preprocessing import LabelEncoder
import numpy as np
from sklearn.metrics import accuracy_score
from sklearn.metrics import mean_squared_error
from sklearn import cross_validation
@pupadupa
pupadupa / Lravel-5-inpalce-edit-using-xeditable.php
Last active May 19, 2022 12:55
Laravel 5 inplace editing using jquery's x-editable plugin . Inline and bulk editing examples.
/**
*
* In this example we create view with inplace and bulk editing.
* Tools and plugins:
* jQuery
* xEditable jquery plugin
* twitter bootstrap
*
*/
@pupadupa
pupadupa / gist:5359142
Created April 10, 2013 22:48
defaultdict example
>>> from collections import defaultdict
>>> dd = defaultdict(str)
>>> dd
defaultdict(<type 'str'>, {})
>>> dd['asd']
''
>>> int(dd['asd'] or 0)
0
>>> dd['aaa']=123
>>> int(dd['aaa'] or 0)
@pupadupa
pupadupa / gist:4588819
Last active December 11, 2015 10:48
How to select skype history on mac osx
cd ~/Library/Application\ Support/Skype/%USERNAME%/
sqlite3 main.db "select datetime(timestamp,'unixepoch'), from_dispname, body_xml from Messages order by timestamp" > /Users/%USERNAME%/Desktop/SkypeHistory.txt
sqlite3 main.db "PRAGMA table_info(Messages);"
@pupadupa
pupadupa / .vimrc
Created October 23, 2012 16:17
.vimrc
syntax on
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2008 Dec 17
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
82 703
83 729
84 6135
85 783
85 703
require 'formula'
class Hadoop < Formula
homepage 'http://hadoop.apache.org/common/'
url 'http://www.sai.msu.su/apache/hadoop/common/hadoop-0.23.1/hadoop-0.23.1.tar.gz'
def shim_script target
<<-EOS.undent
#!/bin/bash
exec "#{libexec}/bin/#{target}" "$@"