Skip to content

Instantly share code, notes, and snippets.

View mohapsat's full-sized avatar
🏁
The future is built on dreams. Hang on to yours!

Satya Mohapatra mohapsat

🏁
The future is built on dreams. Hang on to yours!
View GitHub Profile
@mohapsat
mohapsat / gist:7379401
Created November 8, 2013 23:40
rotating circle in shell script
## --> rotating circle from characters
# --> from http://stackoverflow.com/questions/10470139/creating-rotating-circle-using-characters-in-shell-script
while sleep 1; do
i=$((++i%4 + 2));
printf '\b|/-\' | cut -b 1,$i | tr -d '\n';
done
@mohapsat
mohapsat / README.md
Created October 13, 2016 20:35 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

React.js Introduction For People Who Know Just Enough jQuery To Get By
http://reactfordesigners.com/labs/reactjs-introduction-for-people-who-know-just-enough-jquery-to-get-by/
@mohapsat
mohapsat / gist:9cfc4ddc5ad7be6e5c3bfcf557d8c18e
Created March 18, 2017 21:53
Copy files from one partition to another in red hat
E.g. Talend extracts
source [/dev/sda3] [mounted on /]: /home/usr/talend_extracts
destination [/dev/sdc1] [mounted on /app]: /app/archive/talend/extracts
$pwd
/app/archive/talend/extracts
$sudo cp -afvr . /app/archive/talend/extracts
@mohapsat
mohapsat / gist:fe61cd1c1d50b6ac46508bdd4a448b82
Created August 2, 2017 02:40
To revert to a commit further back than the most recent commit
# To revert to a commit further back than the most recent commit
--------
git reset 56e05fced #resets index to former commit; replace '56e05fced' with your commit code
git reset --soft HEAD@{1} #moves pointer back to previous HEAD
git commit -m "Revert to 56e05fced"
git reset --hard #updates working copy to reflect the new commit
@mohapsat
mohapsat / Area2D_Player_Move
Created July 12, 2018 08:35
[scaffold] Area2D - Player movement
extends Area2D
export var speed = 400
var screensize
var velocity = Vector2()
func _ready():
@mohapsat
mohapsat / Kinematics2D_Player_Movement
Created July 13, 2018 08:19
Kinematics2D_Player_Movement
extends KinematicBody2D
onready var sprite = get_node("sprite")
const UP = Vector2(0, -1)
const GRAVITY = 20
const ACCELARATION = 50
const MAX_SPEED = 400
const JUMP_HEIGHT = -500
const FRICTION = 0.1
@mohapsat
mohapsat / parallax_bg_godot3
Created July 29, 2018 18:46
ParallaxBg_Godot3
To get that ParallaxBackground working:
1. Create a ParallaxBackground node. (It doesn't need to be a child of the Camera2D node, but making it a child of the Camera2D node won't break it either)
2. Create a ParallaxLayer node as a child of the ParallaxBackground.
3. Add your sprite as a child of the ParallaxLayer node and make sure Centered is off.
4. Go back to the ParallaxLayer node.
5. Under Motion, set Mirroring to the size of your sprite (in the case of the Sky sprite, 640x640).
6. Under Motion, fiddle with the Scale setting. This is how fast that ParallaxLayer will move in relation to the camera. I found (0.1, 0.1) to be a good starting point for something like a sky.
7. Run your game, and you should have a background that infinitely loops and also has a parallax effect.
@mohapsat
mohapsat / godot generating_a_scene_tree_dynamically
Created August 16, 2018 17:54
Godot - GraphEdits, GraphNodes, and PopupMenus at runtime
# Ref : https://www.reddit.com/r/godot/comments/7bi5uf/generating_a_scene_tree_dynamically/
# Create a root Node and name is DynamicNodeGraph
extends Node
var RootNode
var SomeGraphEdit
var SomePopupMenu
var SomePopupMenuVisible = false
var RMBPressed = false
@mohapsat
mohapsat / instance scenes from array vars
Created August 17, 2018 02:50
[Godot 3] instance scenes from array vars
# Create 2 scenes 0.tscn and 1.tscn
# Add a Node and call it main
# Add script as below to main
extends Node
var scenes = [0,1]
func _ready():
# randomize()