Skip to content

Instantly share code, notes, and snippets.

@Ivanca
Ivanca / gist:79d3daa0328f0546298c
Created Dec 9, 2014
Collapse Diffs - Functionality for Github commits (UserScript/Tampermonkey/Greasemonkey)
View gist:79d3daa0328f0546298c
// ==UserScript==
// @name Collapse diff
// @namespace http://no.one/
// @version 0.2
// @description Enter something useful
// @author You
// @match https://github.com/*
// @grant none
// ==/UserScript==
View gist:eb3ef598b17a9a8ad10c
var matrix = [
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0]
];
View gist:44f5ba200b92c90046f6
var matrix = [
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 0, 1, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0]
];
@Ivanca
Ivanca / gist:0449d625a158ceec6212
Last active Aug 29, 2015
Duplicate Selected GameObject To all Scenes (For Unity3D) [New Option In Transform inspector Menu]
View gist:0449d625a158ceec6212
using UnityEditor;
using UnityEngine;
using System.Collections;
public class DuplicateToAllScenesMenu : MonoBehaviour {
// Add a menu item called "Double Mass" to a Rigidbody's context menu.
[MenuItem ("CONTEXT/Transform/DuplicateToAllScenes")]
static void DuplicatePlz (MenuCommand command) {
EditorApplication.SaveCurrentSceneIfUserWantsTo ();
View Webflow.js
(function ($) {
var dragging = null;
$(".style-editor").on("mousedown.wf", ".tick", function (e) {
var $ghost = $("<div class='drag-ghost'>").appendTo('body').css(
'cursor', 'ns-resize'
);
var $input = $(this).closest('.input-control').find('input');
dragging = {
@Ivanca
Ivanca / gist:5243025
Last active Dec 15, 2015
Hacker news mobile
View gist:5243025
<style>
@media all and (max-device-width:760px) {
.pagetop b {
display:block;
}
.pagetop {
padding-top: 10px;
padding-bottom: 10px;
@Ivanca
Ivanca / Amara Plus.js
Created Mar 14, 2013
Better control for Amara.org subtitle's editing (youtube subtitles creator and manager).
View Amara Plus.js
// ==UserScript==
// @name Amara Plus
// @namespace http://rapedinheaven.com
// @version 0.1
// @description enter something useful
// @match http://www.amara.org/es/onsite_widget/*
// @copyright 2012+, You
// ==/UserScript==
var getByClass = function (sel, parent) {
@Ivanca
Ivanca / downs.sublime-macro
Last active Dec 13, 2015
The keys are need to be added to your `.sublime-keymap` file (Preferences > Key Bindings - User) [in the array]. Remember to remove the start & end brackets if needed. All the other files (the macros) need to go in the Packages\User directory. The files that have an "_e" at the end are the macros used to expand (eg. when selection is *not* empty)
View downs.sublime-macro
[
{
"args":
{
"extend": false,
"to": "bol"
},
"command": "move_to"
},
{
View gist:4781307
(function () {
var addMethod = function (obj, name, fn) {
obj[name] = function () {
var undef;
var result = fn.apply(obj, arguments);
if (result === undef) {
result = this;
}
return result;
@Ivanca
Ivanca / function.sexy_comment.php
Last active Dec 12, 2015
A PHP function to generate pretty comments for PHP and Javascript.
View function.sexy_comment.php
<?php
/*----------------------------------------------------------------------
|: :|
|: Sexy comments in your code! :|
|: =========================== :|
|: Hi, my name is Ivan I care about programming, music and women. :|
|: Follow me on twitter: @ivanca :|
|: :|
----------------------------------------------------------------------*/