Skip to content

Instantly share code, notes, and snippets.

View flashfoxter's full-sized avatar
🏠
Working from home

Konstantin Le flashfoxter

🏠
Working from home
View GitHub Profile
@flashfoxter
flashfoxter / mount_smbfs.sh
Created March 22, 2019 15:41 — forked from natritmeyer/mount_smbfs.sh
How to mount and unmount a SMB share on Mac OS X (using mount_smbfs)
#Mounting the share is a 2 stage process:
# 1. Create a directory that will be the mount point
# 2. Mount the share to that directory
#Create the mount point:
mkdir share_name
#Mount the share:
mount_smbfs //username:[email protected]/share_name share_name/
@flashfoxter
flashfoxter / selenium-download.py
Created March 19, 2019 19:40 — forked from blaix/selenium-download.py
Download file in a selenium session that requires a cookie from that session
# http://selenium-python.readthedocs.org/en/latest/api.html?highlight=cookie#selenium.webdriver.remote.webdriver.WebDriver.get_cookie
cookie = driver.get_cookie("cookie_name")
subprocess.check_call(["curl", "--cookie", "cookie_name=%" % cookie["value"], url, "-o", "destination_filename")
@flashfoxter
flashfoxter / m3u8-concat.sh
Created March 14, 2019 16:55 — forked from maxwellito/m3u8-concat.sh
Concat / join .ts segment files into an mp4 file
#!/bin/sh
# This script must be executed in the repo where
# the *.ts files are.
# It will concatenate the segments into one temp
# file which ffmpeg will reencode the audio track.
# By default the ouptup filename is output.mp4
# but can be changed by providing the name as parameter.
#
# ffmpeg is required
@flashfoxter
flashfoxter / rsyslog.mail.conf
Created February 26, 2019 09:53 — forked from coderofsalvation/rsyslog.mail.conf
rsyslog multiple ommail email sample configuration
$ModLoad ommail
$ActionMailSMTPServer 127.0.0.1
$template mailSubjectMemory,"Sopflop Memory issue"
$template mailSubjectError,"Sopflop Error"
$template mailSubjectException,"Sopflop Exception"
$template mailBody,"The following event triggered this email:\r\n\r\n%msg%"
### mail on memory issue
$ActionMailFrom [email protected]
<?xml version="1.0" encoding="utf-8"?>
<!-- Add this as a debug manifest so the permissions won't be required by your production app -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
</manifest>
@flashfoxter
flashfoxter / Android Studio Lint Inspections.md
Created August 1, 2018 15:35
Android Lint Suppress Warning Usage

Local Inspections

@SuppressWarnings("UndesirableClassUsage")
@SuppressWarnings("FileEqualsUsage")
@SuppressWarnings("GtkPreferredJComboBoxRenderer")
@SuppressWarnings("UnsafeVfsRecursion")
@SuppressWarnings("ConstantConditions")
@SuppressWarnings("UnusedAssignment")
@SuppressWarnings("NumericOverflow")
@SuppressWarnings("RedundantCast")
@flashfoxter
flashfoxter / MergeIntervals.java
Created July 27, 2018 12:15 — forked from zac-xin/MergeIntervals.java
Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18].
/**
* Definition for an interval.
* public class Interval {
* int start;
* int end;
* Interval() { start = 0; end = 0; }
* Interval(int s, int e) { start = s; end = e; }
* }
*/
@flashfoxter
flashfoxter / BarcodeAdvancedDetector.kt
Created July 25, 2018 15:35 — forked from omarmiatello/BarcodeAdvancedDetector.kt
Barcode Detector for Mobile Vision API (Add support for inverted color)Benchmark on Pixel 2: Invert color (8ms) + Decode (15ms)
package com.satispay.customer.profile.visionapi
import android.graphics.ImageFormat
import android.util.SparseArray
import com.google.android.gms.vision.Detector
import com.google.android.gms.vision.Frame
import com.google.android.gms.vision.barcode.Barcode
import java.nio.ByteBuffer
@flashfoxter
flashfoxter / linkedin auto-inviter
Created July 12, 2018 11:16 — forked from maksii/linkedin auto-inviter
Script to automatically add connections from "People You May Know" page
var inviter = {} || inviter;
inviter.userList = [];
inviter.className = 'button-secondary-small';
inviter.refresh = function () {
window.scrollTo(0, document.body.scrollHeight);
window.scrollTo(document.body.scrollHeight, 0);
window.scrollTo(0, document.body.scrollHeight);
};
@flashfoxter
flashfoxter / CustomView.java
Created June 9, 2018 10:59 — forked from samuel22gj/CustomView.java
Android custom view template
public class CustomView extends View {
public CustomView(Context context) {
this(context, null);
}
public CustomView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public CustomView(Context context, AttributeSet attrs, int defStyle) {