Skip to content

Instantly share code, notes, and snippets.

View evitolins's full-sized avatar
🏠
Working from home

Eriks Vitolins evitolins

🏠
Working from home
View GitHub Profile
<!-- 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 March 8, 2024 02:11
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.
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 April 9, 2024 15:54
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@justinfx
justinfx / modelPanelPyQt4.py
Last active September 15, 2023 03:31
Mixing PyQt4 and Maya UI objects
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 April 23, 2024 04:20
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@santazhang
santazhang / install_ffmpeg.py
Created March 4, 2012 07:55
Python script to compile and install ffmpeg
#!/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 December 5, 2020 12:14
Simple python script to encode videos using ffmpeg
"""
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 December 21, 2012 11:52
JS monkey patching
// 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 April 19, 2024 11:18 — forked from evildmp/gist:3094281
Tutorial to seting up a django website in production.

******************************************************************** 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 February 17, 2024 10:12
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.
#!/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