Skip to content

Instantly share code, notes, and snippets.

View f2face's full-sized avatar
💤

Surya Oktafendri f2face

💤
  • Riau, Indonesia
  • 00:52 (UTC +07:00)
View GitHub Profile
@f2face
f2face / supervisord
Last active April 16, 2018 03:24
Supervisord init script (with chkconfig support). Put this script in /etc/rc.d/init.d/supervisord
#!/bin/bash
# chkconfig: - 99 10
. /etc/rc.d/init.d/functions
DAEMON=/usr/bin/supervisord
PIDFILE=/var/run/supervisord.pid
[ -x "$DAEMON" ] || exit 0
@f2face
f2face / ExpandableHeightGridView.java
Last active February 15, 2024 06:32
Android GridView with auto expanding height.
package com.f2face.app.example.Components;
/* This component class is based on an answer by @tacone on StackOverflow
* Link: https://stackoverflow.com/a/8483078
*/
import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.GridView;
@f2face
f2face / latest-ffmpeg-centos6.sh
Created April 4, 2018 07:47 — forked from mustafaturan/latest-ffmpeg-centos6.sh
Installs latest ffmpeg on Centos 6
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
@f2face
f2face / .htaccess
Created March 13, 2018 19:50
Case insensitive .htaccess rules to block direct access to specific file extensions.
# Example: phtml, htm, html, php
<FilesMatch "(?i)\.(phtml|htm|html|php)$">
Order Allow,Deny
Deny from all
</FilesMatch>
@f2face
f2face / minergate.sh
Created October 5, 2017 21:23
Installing Minergate CLI on Ubuntu x64.
#!/bin/bash
sudo apt-get update && wget https://minergate.com/download/deb-cli && sudo dpkg -i deb-cli
@f2face
f2face / tweetdeck-limit-override.js
Created September 28, 2017 11:51 — forked from erydactyl/tweetdeck-limit-override.js
tweetdeck-limit-override.js
// ==UserScript==
// @name TweetDeck Cramming
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Allow 280 characters in a Tweet sent from TweetDeck automatically
// @author Erydactyl and Zemnmez
// @run-at document-idle
// @match https://tweetdeck.twitter.com/*
// @grant *
// ==/UserScript==
@f2face
f2face / embedDLL.vb
Last active April 20, 2022 12:44
[VB.NET] Embed DLL Reference in EXE as Embedded Resource
' Embed DLL reference into single EXE / Use DLL as embedded resource
' Menggabungkan DLL reference ke dalam EXE sebagai embedded resource, tanpa ILMerge ataupun software merger lainnya.
' Code by TLS (http://stackoverflow.com/a/9678903)
' Persiapan (gambar):
' 1. https://drive.google.com/file/d/0B_JLt2gqN3MPWTcwcWtEbXBLRnM/edit?usp=sharing
' 2. https://drive.google.com/file/d/0B_JLt2gqN3MPRS1GbGRHaFJLaDA/edit?usp=sharing
'==========================================================================================
' 1. Buat Module baru, masukkan kode :
@f2face
f2face / contohClassCustomer.cs
Last active August 29, 2015 13:56
[C#] Membuat class versi ane (contoh kasus: Customer)
/*--------------------------------------------------------
* [C#] Membuat class versi ane.
* by @f2face / Surya Oktafendri ~ 9 Februari 2014
--
* Misal :
Di database ente ada tabel "Customer" dengan atribut: no_customer, nama_customer, alamat_customer.
----------------------------------------------------------*/
class Customer
{
@f2face
f2face / koneksiDB.cs
Last active August 29, 2015 13:56
[C#] Class koneksi dengan MySQL Connector for .NET
/* Persiapan :
* Download MySQL Connector for .NET di http://dev.mysql.com/downloads/connector/net/
* Add reference file "mysql.data.dll" ke project ente (pilih yang sesuai versi .NET Framework yang ente pake di project).
*/
/*-----------------------------------------------------------------------------------------
* Jangan lupa:
using MySql.Data.MySqlClient;
*/
@f2face
f2face / perkalian_matriks.php
Last active December 16, 2020 07:13
[PHP] Fungsi Perkalian Matriks
<?php
/* Fungsi perkalian matriks
* @f2face - 2013
*/
function perkalian_matriks($matriks_a, $matriks_b) {
$hasil = array();
for ($i=0; $i<sizeof($matriks_a); $i++) {
for ($j=0; $j<sizeof($matriks_b[0]); $j++) {
$temp = 0;
for ($k=0; $k<sizeof($matriks_b); $k++) {