Skip to content

Instantly share code, notes, and snippets.

View melastmohican's full-sized avatar

Mariusz Jurgielewicz melastmohican

  • Bellevue, WA
  • 18:52 (UTC -07:00)
View GitHub Profile
@melastmohican
melastmohican / brew_ffmpeg.sh
Created November 12, 2017 04:45
Install FFMPEG with all libs
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libvorbis --with-libvpx --with-opus --with-x265
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
@melastmohican
melastmohican / GetNode.cpp
Created November 3, 2017 23:05
Get Nth element from the end in a linked list
/*
Get Nth element from the end in a linked list of integers
Number of elements in the list will always be greater than N.
Node is defined as
struct Node
{
int data;
struct Node *next;
}
*/
/*
Reverse a linked list and return pointer to the head
The input list will have at least one element
Node is defined as
struct Node
{
int data;
struct Node *next;
}
*/
/*
Detect loop in a linked list
List could be empty also
Node is defined as
struct Node
{
int data;
struct Node *next;
}
*/
@melastmohican
melastmohican / generate_year.sql
Created November 1, 2017 20:38
Generate record every day for 365 days
SELECT TRUNC (SYSDATE - ROWNUM) dt
FROM DUAL CONNECT BY ROWNUM < 365
@melastmohican
melastmohican / rm_idea.sh
Created October 30, 2017 21:51
Remove .idea directory from git
git rm -r --cached .idea
@melastmohican
melastmohican / build.gradle
Created October 19, 2017 05:58
Gradle: build binary patch jar with selected classes only
apply plugin: 'java'
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
jcenter()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
@melastmohican
melastmohican / uuid.sql
Created September 19, 2017 23:14
Oracle's SYS_GUID() as RFC 4122 compliant UUID
--RFC 4122
select regexp_replace(rawtohex(sys_guid()), '([A-F0-9]{8})([A-F0-9]{4})([A-F0-9]{4})([A-F0-9]{4})([A-F0-9]{12})', '\1-\2-\3-\4-\5') as FORMATTED_GUID
from dual;
@melastmohican
melastmohican / process.groovy
Created September 19, 2017 18:12
Execute ps in groovy
#!/usr/bin/env groovy
Process process = Runtime.getRuntime().exec("ps");
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
process.waitFor();
@melastmohican
melastmohican / query2csv.sql
Created September 14, 2017 18:07
Export query results to CSV in Oracle SQL Developer
select /*csv*/ * from test