Skip to content

Instantly share code, notes, and snippets.

@tonY1883
tonY1883 / ValidateYoutubeVideoId.js
Created September 14, 2017 02:18
A small trick to check if youtube video exist with its id.
View ValidateYoutubeVideoId.js
function validVideoId(id) {
var img = new Image();
img.src = "http://img.youtube.com/vi/" + id + "/mqdefault.jpg";
img.onload = function () {
checkThumbnail(this.width);
}
}
function checkThumbnail(width) {
//HACK a mq thumbnail has width of 320.
View Delayed-Feather.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@goldsborough
goldsborough / conv.cu
Last active April 9, 2023 05:14
Convolution with cuDNN
View conv.cu
#include <cudnn.h>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <opencv2/opencv.hpp>
#define checkCUDNN(expression) \
{ \
cudnnStatus_t status = (expression); \
if (status != CUDNN_STATUS_SUCCESS) { \
@marcosecchi
marcosecchi / MenuItemGenerator.cs
Last active April 9, 2023 05:14
Generating menu items at runtime in Unity
View MenuItemGenerator.cs
using UnityEngine;
using UnityEditor;
using System.Text;
namespace TheBitCave {
public class MenuItemGenerator {
/// <summary>
/// Generates a list of menuitems from an array
/// </summary>
@QuantumCD
QuantumCD / Qt 5 Dark Fusion Palette
Created August 15, 2013 21:40
This is a complete (I think) dark color palette for the Qt 5 Fusion theme, as well as a nice style sheet for the tool tips that make them blend better with the rest of the theme. To have immediate effect, be sure to put this in your main function before showing the parent window. Child windows should automatically inherit the palette unless you …
View Qt 5 Dark Fusion Palette
qApp->setStyle(QStyleFactory::create("Fusion"));
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, QColor(53,53,53));
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, QColor(25,25,25));
darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53));
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
View git.diff.txt
diff --git a/.etckeeper b/.etckeeper
index 2373f10..32d85d1 100755
--- a/.etckeeper
+++ b/.etckeeper
@@ -2,6 +2,8 @@
mkdir -p './X11/xkb'
mkdir -p './apache2/mods-available'
+mkdir -p './apt/preferences.d'
+mkdir -p './apt/sources.list.d'
@pbailis
pbailis / gist:8279494
Last active April 9, 2023 05:07
serializable but not linearizable
View gist:8279494
T1: w(x=1)
T2: r(x=null)
SCHEDULE NL:
@ wall clock time 1, T1 begins and commits
@ wall clock time 2, T2 begins and commits
NL is serializable: NL is equivalent to executing T2;T1
NL is not linearizable: T2 should have read x=1
View Good-CONTRIBUTING.md-template.md

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
View dash_simple_example_pandas_datareader.py
# See official docs at https://dash.plotly.com
# pip install dash pandas
from dash import Dash, dcc, html, Input, Output
import plotly.express as px
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv')