Skip to content

Instantly share code, notes, and snippets.

Eriks Vitolins evitolins

Block or report user

Report or block evitolins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View encodingErrorCodes.php
<?
// Source:
// http://www.encoding.com/help/sub_category/category/error_codes
$encoding_errorCodes = array(
"ECOM00229" => "S3 upload error: We encountered an internal error. Please try again.",
"ECOM00228" => "S3 upload error: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.",
"ECOM00230" => "Creating the dir/file failed: No such file or directory.",
@evitolins
evitolins / appendLog.php
Created Feb 4, 2014
Simple way to append data to a log file. Can be used for PHP troubleshooting.
View appendLog.php
<?
$path = '/var/www/myWebsite/myLog.log';
$data = 'myData';
file_put_contents ($path , PHP_EOL . time() .' - ' . $data, FILE_APPEND | LOCK_EX );
?>
@evitolins
evitolins / FontAwesome Layer Icon
Last active Aug 29, 2015
FontAwesome Layer Icon Hack using stacked approach. http://jsbin.com/pikeb/2/edit?html,output
View FontAwesome Layer Icon
<span class="fa-stack fa-rotate-90" style='font-size:40px'>
<i class="fa fa-square fa-stack-1x" style="top: 0; left: 0;"></i>
<i class="fa fa-square fa-stack-1x" style="top: .1em;left: .1em;color:#fff;"></i>
<i class="fa fa-square fa-stack-1x" style="top: .2em;left: .2em;"></i>
<i class="fa fa-square fa-stack-1x" style="top: .3em;left: .3em;color:#fff;"></i>
<i class="fa fa-square fa-stack-1x" style="top: .4em;left: .4em;"></i>
</span>
@evitolins
evitolins / README.md
Last active Aug 29, 2015
StoreFront - A wrapper for store-js adding both local variable usage, and schema/default value definition.
View README.md

StoreFront

What?

StoreFront allows users to set a schema/default values for store.js.

StoreFront also acts as a buffer between store.js and your application. All your '''get()''' queries access a synced object instead of constantly utilizing the browser's storage API. In theory, this should speed up performance when data is accessed frequently.

Why?

StoreFront allows users to easily store and retrieve key pair values, while store-js maintains and restores the data for later sessions. If store-js is not found, StoreFront functions the same, but without leveraging the browser's local storage features.

@evitolins
evitolins / DataModel.js
Last active Aug 29, 2015
A simple class to manipulate key/value data, and execute a defined array callbacks.
View DataModel.js
var DataModel = function () { "use strict";
var data = {},
callbacks = {
'set' : [],
'unset' : []
},
applyCallbacks = function (action, args) {
var cb, len, i;
if (callbacks[action] === undefined) return;
len = callbacks[action].length;
@evitolins
evitolins / dataModel.coffee
Created Aug 11, 2014
A simple class for manipulating key/value pairs, and applying associated callbacks.
View dataModel.coffee
class DataModel
constructor: () ->
@data = {}
@callbacks =
set: []
unset: []
return
applyCallbacks: (action, args) ->
for cb in @callbacks[action]
@evitolins
evitolins / README.md
Last active Aug 29, 2015
Python: Modules, Classes & Objects
View README.md

Python: Modules, Classes & Objects

So in Python you have 3 major tools for code organization…Modules, Classes, & Objects

Modules:

Python modules are pretty much just a single python file. You can think about it as giving your variables and functions a specific namespace to reference within another python script. For example: The code below imports the contents of "mySampleModule.py" to allow all it's contents to be used in another python script under it's namespace (by default, the filename).

import mySampleModule
@evitolins
evitolins / php2json.php
Last active Aug 29, 2015
Simple PHP -> JSON Usage
View php2json.php
<?
/**
*
* Returns an array as JSON formatted data
*
*/
// Automatically Gather Images from a directory
$autoImageList = array();
foreach(glob('./images/*.{jpg,png,gif}') as $filename){
View gist:1195873369f3878a5ad9

RGB: ScriptManager

About

'ScriptManager' gives both Maya users & developers a simple and standardized workflow for the installation and removal of 3rd-party Maya scripts. Files are stored and maintained in an organized fashion, doing away with the process of hand-copying files into their intended Maya folders.

View MayaSubprocess_macOS.py
#Open New Maya
from subprocess import call
appPath = "/Applications/Autodesk/maya2014/Maya.app"
call(["open -n " + appPath], shell=True)
You can’t perform that action at this time.