Skip to content

Instantly share code, notes, and snippets.

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
<?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"
@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>
@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
@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 / 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 / true_false.py
Created February 24, 2016 04:25
True and False in Python
values = [None, 0, "", False, [], {}, "0", True]
for v in values:
if v:
print("True value: {}".format(v))
else:
print("False value: {}".format(v))
# False value: None
# False value: 0
@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) {
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.vlad.happynewyear.MainActivity">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
@VladSem
VladSem / screen.sh
Last active November 25, 2015 03:17
This script help you change the brightness on your laptop (tested on Asus and Intel chipset)
#!/bin/bash
VALUE="$(cat /sys/class/backlight/intel_backlight/brightness)"
echo "Your carrent brightness is: ${VALUE}"
echo "Input your value of brightness: "
read INPUT
echo $INPUT | tee /sys/class/backlight/intel_backlight/brightness