Skip to content

Instantly share code, notes, and snippets.

@konklone
konklone / Dockerfile
Created September 22, 2013 18:17
Dockerfile for installing Ruby 2.0 and RVM
FROM ubuntu
MAINTAINER Eric Mill "eric@konklone.com"
# turn on universe packages
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list
RUN apt-get update
# basics
RUN apt-get install -y nginx openssh-server git-core openssh-client curl
RUN apt-get install -y nano
@asqd
asqd / HTTPHelper.php
Last active March 7, 2018 11:56
HTTPHelper
<?php
namespace common\helpers;
/**
* HttpHelper provides an interface to make HTTP request
*/
class HTTPHelper
{
@asqd
asqd / geo_smart.rb
Created March 22, 2018 08:32
GeoSmartRequester
module GeoSmart
@base_path = "new_url"
@token = "token"
@legacy_path = "old_url"
class << self
attr_accessor :base_path, :token, :legacy_path
end
class Address
@feymartynov
feymartynov / test.exs
Created November 7, 2018 15:35
Lambda vs private function benchmark
defmodule Test1 do
def foo(a) do
bar = fn x ->
x + 1
end
bar.(a)
end
end
@sofakingworld
sofakingworld / bash_result
Last active April 18, 2019 18:52
Timestamps in console
21:49:09 ➜ ~ echo 'Hello world'
Hello world
@asqd
asqd / gitstat.sh
Last active June 17, 2021 14:56
get stats from git repository
#!/bin/bash
strict_mode=false
PARAMS=()
usage() {
cat <<EOF
Usage: gitstat.sh [since] [before] [arguments]
-h, --help Display this help and exit
-o, --out OUTFILE Write stats to OUTFILE instead of standard output
@asqd
asqd / mp3_slicer.py
Last active November 23, 2022 09:08
Python script to slice large mp3 file by chunks
from os import path
from pydub import AudioSegment
import sys
# pydub use ffmpeg to file manupulation
# don't forget to install ffmpeg
sys.path.append('/usr/local/bin/ffmpeg')
def load_songs(fn):
meta = {}
songs = []