Skip to content

Instantly share code, notes, and snippets.

View msurguy's full-sized avatar

Maksim Surguy msurguy

View GitHub Profile
@msurguy
msurguy / index.html
Created October 26, 2012 19:02
A CodePen by Maksim Surguy. CSS3 Thumbnails - Photo thumbnails of various styles : embossed, cutout, taped, Glossy, reflected, Morph and glow on hover, iphone style icons.
<h4>Inspired by <a href="http://webdesignerwall.com/tutorials/css3-image-styles">http://webdesignerwall.com/tutorials/css3-image-styles</a></h4>
<div class="box normal">
<h3>Normal Image (without jQuery background image wrap)</h3>
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/22.png" ></a>
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/21.png"></a>
<a href="http://bootsnipp.com"><img src="http://png.findicons.com/files/icons/2682/construction/128/20.png"></a>
</div>
@msurguy
msurguy / gist:4003696
Created November 2, 2012 19:12 — forked from Termina1/gist:3928508
meteor deploy cake task
exec = require('child_process').exec
ssh = require 'NodeSSH'
scp = require 'scp'
deploy = (host, name, pass, path, start = true, port=3001) ->
client = new ssh host, name, pass
console.log 'connecting to server'
client.connect ->
client.once 'data', ->
console.log 'cleaning old code'
client.write "cd #{path}\r\n"
@msurguy
msurguy / index.html
Created December 4, 2012 17:23 — forked from nhunzaker/index.html
Article 1 - Twittermap Basic Construction
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Twitter Map</title>
<link rel="stylesheet" href="css/style.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>
@msurguy
msurguy / index.html
Created December 18, 2012 21:12
A CodePen by Maksim Surguy.
<input type="button" id="start" value="Start Life" onclick="life.toggleLife();">
<input type="button" value="Clear" onclick="life.clear();">
<canvas id="universe" width="500" height="500">

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
var SomeModel = Backbone.Model.extend({});
someModel = new SomeModel();
someModel.bind("change", function(model, collection){
alert("You set some_attribute to " + model.get('some_attribute'));
});
someModel.set({some_attribute: "some value"});
@msurguy
msurguy / backbone Phonegap Show
Created February 9, 2013 02:41
Backbone PhoneGap animation for elements
Demo.Views.Page = Backbone.View.extend({
className: "page",
initialize: function () {
this.render();
},
show: function () {
$('.page').css({"position": "absolute"});
var direction_coefficient = this.options.back ? 1 : -1;
if ($('.page').length) {
@msurguy
msurguy / share on FB, Twitter or Google+
Created February 22, 2013 20:29
Javascript click events to share on FB, twitter or Google +
$('tweet_link').click(function() {
var width = 550;
var height = 420;
var left = parseInt((screen.availWidth/2) - (width/2));
var top = parseInt((screen.availHeight/2) - (height/2));
var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
myWindow = window.open("https://twitter.com/share?text=myapp.do%20%7C%20%40FreshBooks%20time%20tracking%20for%20to-dos%3A%20&url=http%3A%2F%2Fmyapp.com%2F&via=myapp", "subWind", windowFeatures);
return false;
});
@msurguy
msurguy / drag drop backbone jquery UI
Created March 3, 2013 16:26
drag and drop with backbone
$('#overlay-objet img').droppable({
tolerance: 'pointer',
drop: _.bind(function(event, ui) {
object = $(event.target);
if (object.attr("data-val") != undefined){
objectDrag = object.attr('data-val').toString();
objectDrop = $(ui.draggable).attr('data-val').toString();
//$(ui.draggable).removeClass('objet-drag').addClass('objet-hover');
object.addClass('hidden');
$('#'+object.attr('data-toggle')).removeClass('hidden');
@msurguy
msurguy / controllerandview.php
Created March 10, 2013 00:48
Using Humane.js in Laravel projects. Sometimes you need to show a nice message to the user after some action is executed. Humane.js (http://wavded.github.com/humane-js/) is designed to show you those nice looking messages with ease.
// inside of a controller call:
Session::flash('status_success', 'Succesfully submitted!');
// inside of your view :
<script>
@if (!is_null(Session::get('status_success')))
@if (is_array(Session::get('status_success')))
@foreach (Session::get('status_success') as $success)
displayMessage('{{$success }}', "success");