Skip to content

Instantly share code, notes, and snippets.

View webmonch's full-sized avatar

Vladyslav Melnychenko webmonch

View GitHub Profile
@jbgo
jbgo / git-recover-branch.md
Last active May 23, 2024 12:29
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@AngryAnt
AngryAnt / EditorWindowExample.cs
Created June 15, 2012 08:30
EditorWindowExample from the Unity Asia Bootcamp 12 talk "Streamlining your Unity editor". A simple node based editor.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
public class EditorWindowExample : EditorWindow
{
List<Node> nodes = new List<Node> ();
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 20, 2024 14:04
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@bzgeb
bzgeb / TriggerContainerEditor.cs
Created September 28, 2012 14:52
Example Drag & Drop area in a custom inspector for the Unity editor
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor (typeof(TriggerContainer))]
public class TriggerContainerEditor : Editor
{
private SerializedObject obj;
@thitemple
thitemple / dev_setup.ps1
Last active March 22, 2022 05:19
A PowerShell script for installing a dev machine using Chocolatey.
function Add-Path() {
[Cmdletbinding()]
param([parameter(Mandatory=$True,ValueFromPipeline=$True,Position=0)][String[]]$AddedFolder)
# Get the current search path from the environment keys in the registry.
$OldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
# See if a new folder has been supplied.
if (!$AddedFolder) {
Return 'No Folder Supplied. $ENV:PATH Unchanged'
}
# See if the new folder exists on the file system.
@BrandonSmith
BrandonSmith / AndroidManifest.xml
Last active July 19, 2023 19:11
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@meng-hui
meng-hui / resize_icons.rb
Last active November 14, 2017 15:17
Populate a Unity generated Xcode project with all icons for a Universal build from a single icon file. In the folder with the xcode project, execute this script and by default looks for a file named icon_1024x1024.png and places all the icons needed into Unity-iPhone/Images.xcassets/AppIcon.appiconset/ . Requires gd and fastimage_resize gem
#!/usr/bin/env ruby
# make sure you have gd and fastimage_resize
# brew install gd
# sudo gem install fastimage_resize
require 'fastimage_resize'
require 'optparse'
require 'json'
require 'fileutils'
@coreyjs
coreyjs / simplegamecenter.cs
Last active October 24, 2022 02:12
Unity3d Simple GameCenter Integration
using UnityEngine;
using System.Collections;
using UnityEngine.SocialPlatforms;
using UnityEngine.SocialPlatforms.GameCenter;
public class GameCenter : MonoBehaviour {
static ILeaderboard m_Leaderboard;
public int highScoreInt = 1000;
@dogles
dogles / UISortBehavior.cs
Created December 17, 2014 14:12
MonoBehaviour for sorting Renderers against NGUI widgets.
using UnityEngine;
public class UISortBehavior : MonoBehaviour
{
public UIWidget widgetInFrontOfMe;
[System.NonSerialized]
Renderer m_renderer;
void Awake() {
@fernandezpablo85
fernandezpablo85 / git-maven-howto.md
Last active April 16, 2024 17:02
how to create your own maven repository on github

How to create a maven repository for your github project step by step

Clone your project in a separate folder

(note: replace ORGANIZATION and PROJECT)

git clone git clone git@github.com:ORGANIZATION/PROJECT.git my-repository

Cd into it