Skip to content

Instantly share code, notes, and snippets.

@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@domenic
domenic / q-mongoose-so.js
Last active August 24, 2017 05:49
Q + Mongoose from StackOverflow
var mongoose = require('mongoose');
mongoose.connect('mongo://localhost/test');
var conn = mongoose.connection;
var users = conn.collection('users');
var channels = conn.collection('channels');
var articles = conn.collection('articles');
var insertUsers = Q.nfbind(users.insert.bind(users));
var insertChannels = Q.nfbind(channels.insert.bind(channels));
anonymous
anonymous / pyqt_hypergraph.py
Created December 27, 2012 02:37
Example of using an existing PyQt4 class layout and adding Maya UI elements into the child layouts.
import maya.cmds as cmds
import maya.OpenMayaUI as mui
from PyQt4 import QtCore, QtGui
import sip
class Window(QtGui.QWidget):
"""
An arbitrary layout representing something
@jbandela
jbandela / QT5.2
Last active December 27, 2015 06:49
How to build QT 5.2 with MSVC 2013 Release Static
1) Download
2) extract zip file
3) set DXSDK_DIR= \um\
4) Edit "C:\Users\jrb\Downloads\qt-everywhere-opensource-src-5.2.0-beta1\qt-everywhere-opensource-src-5.2.0-beta1\qtbase\mkspecs\win32-msvc2013\qmake.conf" and change MT to MD
5) C:\Users\jrb\Downloads\qt-everywhere-opensource-src-5.2.0-beta1\qt-everywhere-opensource-src-5.2.0-beta1\qtbase\src\angle\src\libGLESv2\Makefile.Release and replace "c:\program files ..\fxc" with fxc
6) C:\Users\jrb\Downloads\qt-everywhere-opensource-src-5.2.0-beta1\qt-everywhere-opensource-src-5.2.0-beta1\qtbase\src\3rdparty\angle\src\libEGL\Surface.cpp add #include <algorithm>
7) In "C:\Users\jrb\Downloads\qt-everywhere-opensource-src-5.2.0-beta1\qt-everywhere-opensource-src-5.2.0-beta1\qtdeclarative\src\3rdparty\masm\yarr\YarrParser.h"
Add definitions for declarations from C:\Users\jrb\Downloads\qt-everywhere-opensource-src-5.2.0-beta1\qt-everywhere-opensource-src-5.2.0-beta1
\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\yarr\RegexCompiler.cpp
@wormeyman
wormeyman / OpenWithBrackets.bat
Last active January 19, 2022 20:33 — forked from mrchief/LICENSE.md
Run as administrator, when you right click on a file or folder it gives you the option to open in brackets. When you are done close the cmd window.
@echo off
SET st2Path=C:\Program Files (x86)\Brackets\Brackets.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Brackets" /t REG_SZ /v "" /d "Open with Brackets" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Brackets" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Brackets\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Brackets" /t REG_SZ /v "" /d "Open with Brackets" /f
@xdamman
xdamman / install_ffmpeg_ubuntu.sh
Created July 2, 2014 21:03
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@voluntas
voluntas / webrtc.rst
Last active May 21, 2024 13:55
WebRTC の未来
@terrydang
terrydang / install_nvidia_driver_in_ubuntu1604.md
Last active August 8, 2022 09:31
Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

@terrydang
terrydang / install_cuda_7_5_Unbuntu_16_04.md
Created May 27, 2016 03:23
Ubuntu 16.04 安装 NVIDIA CUDA Toolkit 7.5

Ubuntu 16.04 安装 NVIDIA CUDA Toolkit 7.5

NVIDIA CUDA Toolkit 7.5 目前官方只适配了 Ubuntu 15.04 和 Ubuntu 14.04 两个版本的系统。如果你是这两个系统,可以直接去官方下载安装文件安装。

由于其没有适配 Ubuntu 16.04 ,这里我们通过下载官方为 CUDA 7.5 为 Uubuntu 15.04 适配的 runfile(local) 安装。

@terrydang
terrydang / install_tensorflow_form_source_Ubuntu_16_04.md
Last active April 2, 2018 05:48
Ubuntu 16.04 安装 tensorflow with GPU support(源码编译安装)

Ubuntu 16.04 安装 tensorflow with GPU support(源码编译安装)

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

1. 安装依赖