Skip to content

Instantly share code, notes, and snippets.

View flashvnn's full-sized avatar

Huynh Khac Thao flashvnn

View GitHub Profile
@cirippo
cirippo / ReadMe.md
Last active April 2, 2025 08:21
Download Google Drive protected PDF without TrustedScriptURL error at higher resolution

Easy step by step guide to download view only PDF from Google Drive - no TrustedScriptURL error and better quality


  1. Open the document in Google Docs
  2. Zoom in 2 times using Ctrl and + (VERY IMPORTANT!)
  3. Open Developer Tools
  4. Hit Ctrl + R to reload the document.
  5. Scroll to the bottom of the document to load all pages.
  6. To check if all pages are loaded, go to "Network" tab, type "img" in search bar. At the bottom bar you see "xx/yyy requests", "xx" must be equal to document's pages; if not scroll up to load missing pages
  7. Go to "Console" tab
  8. Paste the updated and improved script (download_pdf.js) that avoids TrustedScriptURL error and allows better file's quality
@gustavorv86
gustavorv86 / samba-server-for-xiaomi-cameras.md
Last active January 15, 2025 13:11
How to configure a low-cost NAS server for a Xiaomi MI Home Security Camera

Samba Server configuration for Xiaomi MI Home Security Camera

This manual explains how to set up a low-cost NAS server to store videos from a Xiaomi camera, model MI Security Camera.

You can use a development board Linux based such as Raspberry PI or similar, an old PC, Barebone etc.

NAS Server Configuration

Install samba.

@vilkoz
vilkoz / setup_http_server_on_android_with_termux.md
Last active March 19, 2025 20:13
setup http server on android with termux

Setting up http server on android with termux

Setting SSH server

To be able to make all procedures without pain you should have physical keyboard or just install ssh server and connect to your device shell from computer.

Folow this guide to setup ssh server.

Installing needed stuff

@cb109
cb109 / breakpoint.js
Last active September 3, 2024 13:37
Vue Breakpoints Mixin (also available via npm: https://www.npmjs.com/package/vue-md-breakpoint)
// Now officially integrated into Vuetify:
//
// https://github.com/vuetifyjs/vuetify/blob/master/src/components/VApp/mixins/app-breakpoint.js
// https://github.com/vuetifyjs/vuetify/blob/master/src/components/VApp/mixins/app-breakpoint.spec.js
/**
* A Vue mixin to get the current width/height and the associated breakpoint.
*
* Useful to e.g. adapt the user interface from inside a Vue component
* as opposed to using CSS classes. The breakpoint pixel values and
@crittermike
crittermike / import.php
Last active August 28, 2024 06:43
Importing Drupal 8 config programmatically
<?php
// Import arbitrary config from a variable.
// Assumes $data has the data you want to import for this config.
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html');
$config->setData($data)->save();
// Or, re-import the default config for a module or profile, etc.
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module');
@harish2704
harish2704 / lodash.get.js
Last active February 21, 2025 08:14
Simple lodash.get function in javascript
/* Implementation of lodash.get function */
function getProp( object, keys, defaultVal ){
keys = Array.isArray( keys )? keys : keys.split('.');
object = object[keys[0]];
if( object && keys.length>1 ){
return getProp( object, keys.slice(1) );
}
return object === undefined? defaultVal : object;
}
@rid00z
rid00z / AsyncHelper.cs
Created September 19, 2015 03:11
This code can be used to task a async task and run it without the async part.
public static class AsyncHelper
{
private static readonly TaskFactory _myTaskFactory = new
TaskFactory(CancellationToken.None,
TaskCreationOptions.None,
TaskContinuationOptions.None,
TaskScheduler.Default);
public static TResult RunSync<TResult>(Func<Task<TResult>> func)
{
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Markup;
using Cirrious.CrossCore.Wpf.Converters;
using Cirrious.MvvmCross.Localization;
@geirsagberg
geirsagberg / StoryBoardContainer.cs
Last active November 19, 2015 12:02
MvvmCross load views from Storyboards using a custom attribute
public class StoryBoardContainer : MvxTouchViewsContainer
{
protected override IMvxTouchView CreateViewOfType(Type viewType, MvxViewModelRequest request)
{
var storyboardAttribute = viewType.GetCustomAttribute<FromStoryboardAttribute>();
if (storyboardAttribute != null) {
var storyboard = UIStoryboard.FromName(storyboardAttribute.StoryboardName ?? viewType.Name, null);
var viewController = storyboard.InstantiateViewController(viewType.Name);
return (IMvxTouchView) viewController;
}
@MitchMilam
MitchMilam / ListViewAlternatingBackgroundColors.cs
Last active August 30, 2023 20:34
Alternating background colors in a Xamarin.Forms ListView
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace XamarinFormsDeepDive
{
class ListViewDemo : ContentPage
{
class Person
{