Skip to content

Instantly share code, notes, and snippets.

View karuna's full-sized avatar
🦡
Badger Badger Badger

Karuna Murti karuna

🦡
Badger Badger Badger
View GitHub Profile
@karuna
karuna / unshift
Last active October 22, 2016 17:48
$:.unshift File.dirname(__FILE__) + '/lib'
@karuna
karuna / counter.rb
Last active August 26, 2016 09:57
training
#!/bin/ruby
t = gets.strip.to_i
k = 2Math.log2(t/3+1).floor
puts 3*(2**k) - (k*3)
1 = 3 = 2 ** 0 * 3 - (k * 3)
2 = 2 = 2 ** 0 * 3 - 1
3 = 1 = 2 ** 0 * 3 - 2
@karuna
karuna / cloudSettings
Last active March 3, 2019 05:11
Visual Studio code settings
{"lastUpload":"2019-03-03T05:11:24.879Z","extensionVersion":"v3.2.5"}
@karuna
karuna / MaterialDark.colors
Created June 14, 2016 05:32
Material Dark KDE Color Scheme
[ColorEffects:Disabled]
Color=56,56,56
ColorAmount=0
ColorEffect=0
ContrastAmount=0.65000000000000002
ContrastEffect=1
IntensityAmount=0.10000000000000001
IntensityEffect=2
[ColorEffects:Inactive]
@karuna
karuna / font-compare.txt
Created June 7, 2016 01:58
Snippets for comparing monospace fonts
* b69B80Oo
* 1Il|
* ij
* 5S
* 9gq
* co
* rn m
* cl d
* vv w
* .,
used:
+dba +ipv6 +dom +calendar +wddx +static +inifile +inline +cli +fpm +ftp +filter +gcov +zts +json +hash +exif +mbstring +mbregex +libgcc +pdo +posix +sockets +debug +phpdbg +zip +bcmath +fileinfo +ctype +cgi +soap +pcntl +intl +phar +session +tokenizer +opcache +imap +tidy +kerberos +xmlrpc +pcre +mhash +mcrypt +zlib +curl +readline +gd +openssl +mysql +sqlite +pgsql +xml +xml_all +gettext +iconv +bz2 +ipc +gmp +apxs2
not used:
+embed +icu
diff --git a/PKGBUILD b/PKGBUILD
index 6dab413..b0e384d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,13 +17,13 @@ conflicts=(
backup=('etc/php/conf.d/redis.ini')
source=(
- http://pecl.php.net/get/redis-${pkgver}.tgz
+ https://github.com/phpredis/phpredis/archive/php7.zip
@karuna
karuna / gist:cdd47fe1664349907bcb
Created September 27, 2015 06:54
new bash prompt
set_prompt (){
red="\[\033[38;5;1m\]"
green="\[\033[38;5;10m\]"
yellow="\[\033[38;5;11m\]"
grape="\[\033[38;5;92m\]"
strawberry="\[\033[38;5;9m\]"
mellon="\[\033[38;5;162m\]"
name="$red🍒$space$green🍏$space$red🍓$space$color4"
host="$color3\h$color4"
path="$color5\w$color4"
@karuna
karuna / wave.c
Created July 5, 2015 10:37
wave radio for indonesia
#include <math.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <machine/speaker.h>
#define SPEAKER "/dev/speaker"
static struct tm *ptmOurs;
// npm install node-gpsd
var gpsd = require('node-gpsd');
var gpsData = "No GPS data received.";
var gpsListener = new gpsd.Listener({
port: 2947,
hostname: 'localhost'
});
function startGPS () {