Skip to content

Instantly share code, notes, and snippets.

View HappyHalloween.java
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
View happy_halloween.xml
<?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 Jan 24, 2019
Sitemap for Blogger
View sitemap.html
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 Jun 17, 2016
tmux - how to open up a set of panes without manually entering them?
View dev-tmux.sh
#!/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 Jul 24, 2019
Cut 4 seconds of youtube video using Python and ffmpeg
View cut_video.py
#!/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 Mar 28, 2016
Python, Tkinter - UTF-8 Converter (from Windows-1251 to utf-8) in Linux environment
View check_incoding.py
#!/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 Feb 24, 2016
True and False in Python
View true_false.py
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 Dec 22, 2015
Android, onSaveInstanceState and onActivityCreated in fragments
View FragmentTab1.java
public class FragmentTab2 extends Fragment {
String msg = "Android : ";
Button buttonON;
TextView showIP1;
TextView showIP2;
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container,
Bundle savedInstanceState) {
View happy_new_year.xml
<?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 Nov 25, 2015
This script help you change the brightness on your laptop (tested on Asus and Intel chipset)
View screen.sh
#!/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