Skip to content

Instantly share code, notes, and snippets.

View VladSem's full-sized avatar

Sevlan VladSem

View GitHub Profile
@VladSem
VladSem / FragmentTab1.java
Created December 22, 2015 02:30
Android, onSaveInstanceState and onActivityCreated in fragments
public class FragmentTab2 extends Fragment {
String msg = "Android : ";
Button buttonON;
TextView showIP1;
TextView showIP2;
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container,
Bundle savedInstanceState) {
@VladSem
VladSem / dev-tmux.sh
Created June 17, 2016 19:17
tmux - how to open up a set of panes without manually entering them?
#!/bin/sh
# pane 1
tmux new-session -d 'sudo minicom mydevice'
# pane 2
tmux split-window -h 'sudo watch fastboot devices'
tmux split-window -v -p 90
# pane 3
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.android.happyhalloween.MainActivity">
<ImageView
android:id="@+id/photo_image_view"
package com.android.happyhalloween;
import android.graphics.Typeface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
@VladSem
VladSem / tmux2_raspberry.sh
Created May 23, 2015 05:43
install tmux 2.0 on Raspberry Pi (Debian 7.8) Raspbian Wheezy
#!/bin/bash
wget "https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz"
tar -xf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure
make
make verify
sudo make install
sudo ldconfig
@VladSem
VladSem / tmux_ubuntu14.04.sh
Last active July 7, 2020 21:12
install tmux 2.0 on Ubuntu 14.04
sudo apt-get update
sudo apt-get install -y python-software-properties software-properties-common
sudo add-apt-repository -y ppa:pi-rho/dev
sudo apt-get update
sudo apt-get install -y tmux=2.0-1~ppa1~t
@VladSem
VladSem / check_incoding.py
Created March 28, 2016 04:28
Python, Tkinter - UTF-8 Converter (from Windows-1251 to utf-8) in Linux environment
#!/usr/bin/python
# -*- coding: utf-8 -*-
import chardet
import Tkinter
from Tkinter import Label
from Tkinter import Tk
from Tkinter import X
from tkFileDialog import askopenfilename
import os
@VladSem
VladSem / cut_video.py
Last active June 15, 2023 14:31
Cut 4 seconds of youtube video using Python and ffmpeg
#!/usr/bin/python
from __future__ import print_function
import os
cur_dir = os.path.dirname(os.path.realpath(__file__))
input_folder = "original_clips/"
output_folder = "output/"
os.system("mkdir " + output_folder)
@VladSem
VladSem / sitemap.html
Last active November 1, 2023 08:07
Sitemap for Blogger
Step 1. Login to your Blogger Dashboard and select your blog
Step 2. Go to Pages > click the New Page button and select Blank page
Step 3. Click on the HTML tab and paste the following code inside the empty box:
<style>
p.labels a{color: #242424; text-transform: uppercase;font-size: 15px;}
a.post-titles {color: #0000FF;}
ol li{list-style-type:decimal;line-height:25px;}
</style>