Skip to content

Instantly share code, notes, and snippets.

View frantic's full-sized avatar
👾

Alex Kotliarskyi frantic

👾
View GitHub Profile

JNI Example (Mac OS)

JNI (Java Native Interface) allows implementing methods in C/C++, and use them in Java.

1. Create JNIExample.java file

class JNIExample {

  // Native method, no body.
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active March 2, 2023 13:29
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
@alexander-yakushev
alexander-yakushev / "Stonebreakers" by Ivan Franko
Last active October 5, 2022 04:27
Amateur translation from Ukrainian to English of the poem "Каменярі" ("Kamenyari") written by Іван Франко (Ivan Franko) in 1878.
I had a dream. Like there is ahead
And endless, empty and the wildest plane.
And I stand there, held by iron chain,
Under the tall rock made from finest granite
And next to me are thousands just like me.
The face of everyone is marked by woe and sorrow,
And eyes of everyone contain fervor of love.
And hands of everyone are chained with snakes of iron,
And every shoulder's bent low to the ground,
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@proger
proger / badge.py
Created February 11, 2013 15:47
run any process with a badge!
#!/usr/bin/env python
import sys
sys.path.insert(0, '/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
import lldb
dbg = lldb.SBDebugger.Create()
dbg.SetAsync(False)
@clarkware
clarkware / lyrics.rb
Created September 10, 2012 20:05
Random Lyrics
#!/usr/bin/env ruby
# API Documentation at http://api.wikia.com/wiki/LyricWiki_API
require 'open-uri'
require 'json'
require 'tmpdir'
ARTIST = "Johnny Cash"
# -*- encoding: utf-8 -*-
#http://en.wiktionary.org/wiki/Index:Chinese_radical
ua_cn = {
'а' => '开',
'б' => '石',
'в' => '阝',
'г' => '厂',
'ґ' => '广',