Skip to content

Instantly share code, notes, and snippets.

View krisanalfa's full-sized avatar

Krisan Timur krisanalfa

  • Denpasar, Bali
View GitHub Profile
@krisanalfa
krisanalfa / vmblock-9.0.2-5.0.2-3.12.patch
Created November 18, 2013 08:51
VMWare vmblock patch for 3.12 kernel. It's ony works for VMPlayer 5.0.2 or VMWare Workstation 9.0.2
diff -Naur a/linux/control.c b/linux/control.c
--- a/linux/control.c 2013-10-03 04:29:47.471339204 -0400
+++ b/linux/control.c 2013-10-03 04:31:56.607334636 -0400
@@ -283,7 +283,7 @@
int i;
int retval;
- name = getname(buf);
+ name = (char*)getname(buf)->name;
if (IS_ERR(name)) {
@krisanalfa
krisanalfa / PKGBUILD
Created October 31, 2013 10:10
eAccelerator PHP for Arch Linux
# Maintainer: Krisan Alfa Timur <krisan47@gmail.com>
pkgname=eaccelerator-git
pkgver=1.0
pkgrel=2
pkgdesc="A free open-source PHP accelerator, optimizer, and dynamic content cache."
arch=('i686' 'x86_64')
url="http://eaccelerator.net/"
license=('GPL')
depends=('php')
@krisanalfa
krisanalfa / eaccelerator.patch
Created October 31, 2013 09:56
eAccelerator Patch
--- eaccelerator.orig 2013-10-31 16:51:48.000000000 +0700
+++ eaccelerator.c 2013-10-31 16:52:20.000000000 +0700
@@ -63,7 +63,7 @@
#include "php.h"
#include "php_ini.h"
-#include "php_logos.h"
+/*#include "php_logos.h"*/
#include "main/fopen_wrappers.h"
#include "ext/standard/info.h"
@krisanalfa
krisanalfa / getIndexOf.cpp
Last active December 18, 2015 17:59
Get index of array, input something to a new array, and do any operation to that new array
#include <cstdlib>
#include <iostream>
using namespace std;
// Declare global variable here
string defaults[6] = { "Annisa", "Isyana", "Hifni", "Riska", "Alfa", "Omega" }; // Default array
int arrSize = sizeof(defaults) / sizeof(*defaults); // Ukuran array
float batasLulus = 6.5; // Batas lulusnya berapa? Kalo lebih dari ini, maka dinyatakan lulus
@krisanalfa
krisanalfa / GitPostToTwitter.sh
Created June 7, 2013 08:51
Post your 'commit message' and your 'commit url' to Twitter when you push your code to GitHub.
#!/usr/bin/env bash
# File name: GitPostToTwitter
# Author: Krisan Alfa Timur
command -v twidge > /dev/null
if [[ -d .git ]]; then
if [[ $? -eq 0 ]]; then
read_git_hub=$(cat .git/config | grep github);
if [[ $read_git_hub == "" ]]; then
@krisanalfa
krisanalfa / Preferences.sublime-settings
Last active December 18, 2015 04:49
My Sublime Text 2 Config
{
"caret_style": "phase",
"draw_white_space": "none",
"ensure_newline_at_eof_on_save": true,
"font_face": "Ubuntu Mono",
"font_size": 17,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
#!/bin/bash
# Variable
arch=$(uname -m)
url32="http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1.tar.bz2"
url64="http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2"
extractOutput=
# Function
cin() {
@krisanalfa
krisanalfa / share.html
Created May 16, 2013 08:51
Share Many on Social Network
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<div class="g-plusone" data-size="standard" data-annotation="none" data-href="http://double-dragon.blogspot.com"></div>
<a href="https://twitter.com/intent/tweet?text=I love Twitter development&related=krisanalfa&via=krisanalfa">Tweet</a>
<a href="http://www.facebook.com/sharer.php?s=100&p[title]=Krisan Alfa&p[summary]=I love programming&p[url]=https:twitter.com/krisanalfa&p[images][0]https://si0.twimg.com/profile_images/3649058380/70ffa157f05c25c5b87e52cd07a7149e.png" target="_blank">Facebook</a>
@krisanalfa
krisanalfa / are_you_updated.sh
Created May 13, 2013 06:58
Find out if you are using the latest stable kernel from kernel.org or not
#!/usr/bin/env bash
latest=$(curl https://www.kernel.org/ -s | sed -n "/<td id=\"latest_link\">/,/<\/td>/p" | sed -n -e 's/.*<a.*>\(.*\)<\/a>.*/\1/p');
yours=$(uname -r | sed 's/-.*$//g');
if [[ $latest == "" ]]; then
echo "Please connect to internet"
else
if [[ $latest == $yours ]]; then
echo "You are updated!"
@krisanalfa
krisanalfa / HTML5.sublime-snippet
Last active December 16, 2015 14:39
Put it on "~/.config/sublime-text-2/Packages/User/" folder. Create an HTML document (by extension or by syntax), and type "html5" -> TAB.
<snippet>
<content><![CDATA[
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js" lang="en"> <![endif]-->
<html>
<head>