Skip to content

Instantly share code, notes, and snippets.

Avatar

Eriks Vitolins evitolins

View GitHub Profile
View video-client.html
<!-- This is a Node+WebSocket powered demo to sync videos
across different browsers. This file is the client,
the other one is the Node server. Powered by Node and
http://github.com/miksago/node-websocket-server -->
<style>
.inactive { display: none; }
.active { display: block; }
</style>
<script>
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active Oct 22, 2020
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
View node-and-npm-in-30-seconds.sh
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@cowboy
cowboy / HEY-YOU.md
Last active Jul 29, 2020
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@justinfx
justinfx / modelPanelPyQt4.py
Last active Dec 24, 2019
Mixing PyQt4 and Maya UI objects
View modelPanelPyQt4.py
from PyQt4 import QtCore, QtGui
import maya.cmds as cmds
import maya.OpenMayaUI as mui
import sip
class MyDialog(QtGui.QDialog):
@gre
gre / easing.js
Last active Oct 25, 2020
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
View easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: t => t,
// accelerating from zero velocity
easeInQuad: t => t*t,
// decelerating to zero velocity
@santazhang
santazhang / install_ffmpeg.py
Created Mar 4, 2012
Python script to compile and install ffmpeg
View install_ffmpeg.py
#!/usr/bin/env python
#
# Python script to compile and install ffmpeg.
#
# part of ffcluster project.
# see full project at github.com/santazhang/ffcluster
#
# Author: Santa Zhang <santa1987@gmail.com>
import os
@derekkwok
derekkwok / encode.py
Last active Aug 10, 2020
Simple python script to encode videos using ffmpeg
View encode.py
"""
This python script encodes all files that have the extension mkv in the current
working directory.
Sources:
http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
"""
import subprocess, os
#-------------------------------------------------------------------------------
@naholyr
naholyr / monkey-patch.js
Created Dec 21, 2012
JS monkey patching
View monkey-patch.js
// Original method
var object = {
method: function (x, y) {
return x+y;
}
}
// Add operations before or after!
object.method = (function (original) {
return function (x, y) {
@Atem18
Atem18 / gist:4696071
Last active Oct 15, 2020 — forked from evildmp/gist:3094281
Tutorial to seting up a django website in production.
View gist:4696071

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@JamieMason
JamieMason / is_installed.sh
Last active Jul 19, 2020
Check if a program exists from a bash script.Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
View is_installed.sh
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
You can’t perform that action at this time.