Skip to content

Instantly share code, notes, and snippets.

Felix Oghină foghina

Block or report user

Report or block foghina

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View breaking-changes.md
  • [46dc46a] changes when we clear the current activity from the ReactContext: moved it from onPause to onDestroy. This is generally good news, as you have access to the Activity in more situations, but if you were relying on the Activity being null in paused state, you'll need to change your code.
  • [0b5c612] changes how we forward Activity lifecycle events to listeners: we no longer send events generated by background Activities. The biggest implication of this is probably that, if you are using multiple React Activities, won't receive onHostDestroy() until the last React Activity is destroyed. Furthermore, if you're writing your own custom activities, make sure to call the new API (ReactInstanceManager#onHostPause(Activity) and co.) to benefit from this.
  • [3c4fd42] adds a FragmentActivity-based React Activity class, to support using libraries that rely on this. In order to achieve DRY, most of the Activity methods (onCreate, getReactNativeHost etc.) are now delegated to `ReactAc
View cloudflare_dynamic_dns.py
#!/usr/bin/python
# Set up a new A record in Cloudflare, add the details of it along with your account details below
# Make sure this script runs on startup (or whenever you get a new IP...)
#
# Updated for Python 3.
#
# @author Aaron Rice <aaron@duedil.com>
# @author Felix Oghină <felix@oghina.com>
View gist:5336270
PS1='\[\033[1;32m\]\w`__git_ps1`€\[\033[0m\] '
@foghina
foghina / bashsurv.sh
Last active Oct 12, 2015
Video Surveillance in Bash
View bashsurv.sh
#!/bin/bash
OUTPUT_DIR="/var/www/bashsurv"
FFMPEG_INPUT_FLAGS="-rtsp_transport tcp"
FFMPEG_SOURCE="rtsp://192.168.1.123/video.mp4"
FFMPEG_OUTPUT_FLAGS="-r 20 -acodec libspeex"
FFMPEG_OUTPUT_EXT="ogv"
CLIP_LENGTH=600 # seconds
TIMELIMIT=620 # seconds, allows for network timeout over CLIP_LENGTH
KEEP_FILES_FOR=10080 # minutes
@foghina
foghina / sublime-text.desktop
Created Sep 18, 2012
Sublime Text 2 .desktop file
View sublime-text.desktop
# ~/.local/share/applications/sublime-text.desktop
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/opt/sublime/sublime_text %U
MimeType=text/plain;
Name=Sublime Text 2
Comment=Sublime Text is a sophisticated text editor for code, html and prose. You'll love the slick user interface and extraordinary features.
@foghina
foghina / gist:1206035
Created Sep 9, 2011
Sublime Text 2 Failed Snippet
View gist:1206035
[
{ "keys": ["ctrl+shift+i"], "command": "insert_snippet", "args": {"contents": "I18n.t($SELECTION)"}, "context":
[
{"key": "scope", "operator": "regex_contains", "operand": "ruby", "match_all": true }
]
}
]
You can’t perform that action at this time.