Skip to content

Instantly share code, notes, and snippets.

View paveltimofeev's full-sized avatar

Pavel Timofeev paveltimofeev

View GitHub Profile
@bradland
bradland / ssh-known-hosts-mgmt.sh
Last active April 4, 2023 21:21
SSH known_hosts tools
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com
@AngryAnt
AngryAnt / Menu.cs
Created September 30, 2012 07:38
Example code for "Building a menu of delegates and enums" blog post on AngryAnt.com
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Menu : MonoBehaviour
{
delegate void OnGUIImplementation();
public enum MenuState {Main,Settings,Credits};
public struct Settings
{
@AngryAnt
AngryAnt / PackageInfo.cs
Created November 8, 2012 09:19
Utility editor script for displaying a dialog message when it is imported. Useful for adding messages to asset store packages for instance. Rather than just showing a dialogue, this could also be used as a platform for running an actual package installer
using UnityEngine;
using UnityEditor;
[InitializeOnLoad]
public class PackageInfo
{
const string kTitle = "Notice", kMessage = "This package is the prettiest of them all.", kButton = "Ok", kPackageIdentifier = "AwesomePackage";
@mariocesar
mariocesar / dyndns_route53.py
Created November 25, 2012 06:08
Update a Route53 Record if your public IP changes. Like DynDNS
"""
Requeriments:
$ sudo pip install boto dnspython
Edit ~/.boto to use your AWS credentials
"""
import time
import sys
@alexjs
alexjs / cors-nginx.conf
Created November 28, 2012 22:42 — forked from michiel/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.
@keijiro
keijiro / ScreenRecorder.cs
Last active January 26, 2022 05:01
Screen recording utility.
using UnityEngine;
using System.Collections;
public class ScreenRecorder : MonoBehaviour
{
public int framerate = 30;
public int superSize;
public bool autoRecord;
int frameCount;
@sevcsik
sevcsik / nodejs-angularjs-common-modules.md
Last active February 15, 2022 09:38
Sharing modules between NodeJS and AngularJS

They say that one of the pros of NodeJS is that you use the same language on the back-end and the front-end, so it's easy to share code between them. This sounds great in theory, but in practice the synchronous dependency handling in NodeJS works completely different than any client-side frameworks (which are asynchronous).

Usually that means that you end up copy-pasting your code between your NodeJS sources and your client-side sources, or you use some tool like Browserify, which is brilliant, but they add an extra step in the build process and most likely will conflict with the dependency handling of the framework of your choice (like AnularJS DI). I couldn't look in the mirror if I would call that code sharing.

Fortunately, with a couple of lines of boilerplate code, you can write a module which works in NodeJS and AngularJS as well without any modification.

No globals in the front-end, and dependencies will work. The isNode and isAngular va

@pakdev
pakdev / copyright.py
Last active August 26, 2021 12:03
Adds/updates a copyright header on *.cs files
@NovaSurfer
NovaSurfer / FadeInOut.cs
Last active February 5, 2022 15:59
Unity3D screen fading script (using new UI)
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.SceneManagement;
public class ScreenFader : MonoBehaviour
{
public Image FadeImg;
public float fadeSpeed = 1.5f;
public bool sceneStarting = true;