Skip to content

Instantly share code, notes, and snippets.

@schlarpc
schlarpc / enable-shadowplay-task.xml
Created January 8, 2021 20:58
Enable ShadowPlay on computer unlock (RDP fix)
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2021-01-08T12:52:30.0596384</Date>
<Author>MUFFIN\User</Author>
<URI>\Enable ShadowPlay</URI>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
<Enabled>true</Enabled>
@mashingan
mashingan / simplest_player.c
Created December 17, 2019 14:05
Simplest example of creating player using FFMpeg and SDL2. Currently with choppy audio playing.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
#include <windows.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
//#include <libavutil/frame.h>
#include <SDL2/SDL.h>
@leosuncin
leosuncin / JDownloader2.sh
Last active May 28, 2024 09:44
JDownloader 2 headless startup script
#!/bin/sh
DESC="JDownloader 2 Headless"
NAME=JDownloader2
PIDFILE=/var/run/$NAME.pid
COMMAND="/usr/bin/java -- -Djava.awt.headless=true -jar /home/osmc/jDownloader2/JDownloader.jar"
RUN_AS=osmc
d_start() {
start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE --chuid $RUN_AS --exec $COMMAND
@michahoiting
michahoiting / c-vtable.c
Created April 12, 2016 13:23
vtable example in C
#include <stdio.h>
/* class definitions */
typedef struct Base
{
void (**vtable)();
int _x;
} Base;
typedef struct Child
@seungdols
seungdols / CustomDatePicker.java
Created December 2, 2015 07:18
JavaFX - Use DatePicker custom "format"
public class Project_formController implements Initializable, LimitText {
private static final Logger logger = LoggerFactory.getLogger(Project_formController.class);
@FXML
private TextField tf_projNM;
@FXML
private DatePicker proj_SDT;
@FXML
private DatePicker proj_EDT;
@FXML
@gldraphael
gldraphael / AppCompatPreferenceActivity.java
Last active May 22, 2019 17:19
Abstract base class for the SettingsActivtiy which implements and proxies the necessary calls to be used with AppCompat, and the Settings Activity that inflates a toolbar at runtime.
package com.example.activities;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import android.app.Activity;
import android.app.Dialog;
import android.support.v4.app.DialogFragment;
/**
* Base dialog fragment.
* @param <Listener> listener type.
*/
public abstract class BaseDialogFragment<Listener> extends DialogFragment {
@ec84b4
ec84b4 / gist:d56c00fb5fd2dfaf279b
Last active June 26, 2018 06:22
recycler view header adapter
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
/**
* Created by khaled bakhtiari on 10/26/2014.
* <a href="http://about.me/kh.bakhtiari">
*/
@Noitidart
Noitidart / _ff-addon-snippet-AddToolbarButtonToPalette.js
Last active December 25, 2019 03:04
_ff-addon-snippet-AddToolbarButtonToPalette - This shows how to add button to the toolbar palette and on customize it shows how to store the position/order of the icon. Reason to add to palette instead of adding directly to addonbar or navbar is so that user can customize. It is the XUL Overlay equivalent of adding `toolbarbutton` to `<toolbarpa…
var doc = document;
var win = doc.defaultView;
var toolbox = doc.querySelector('#navigator-toolbox');
var buttonId = 'bpMyBtn';
var button = doc.getElementById(buttonId);
if (!button) {
button = doc.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbarbutton');
button.setAttribute('id', buttonId);
@sakurabird
sakurabird / ExpandableHeightGridView.java
Last active April 6, 2023 17:20
AndroidのScrollViewの中のGridViewのlayout_heightが伸び縮みしないのを独自Viewで克服
package xx.xxx.xx.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.GridView;
/**
* ScrollViewの中のGridViewでも高さを可変にする<br>
* http://stackoverflow.com/questions/8481844/gridview-height-gets-cut