Skip to content

Instantly share code, notes, and snippets.

View agungf's full-sized avatar

Agung Firdaus agungf

  • Jakarta, Indonesia
View GitHub Profile
@agungf
agungf / cara akses pakai jquery
Created January 21, 2012 06:55
indonesia operators regex
var phoneNumber = '08111111'; //nomor yang akan di test
$.each(operators, function(service, operator) {
//console.log("%o : %o ", service, operator);
if (operator["pattern"].test(phoneNumber)) {
//do some thing with here or simple alert (for testing)
alert("%s iku cocok karo: $s -> jeneng produk'e: $s soko operator %s", phoneNumber, operator["pattern"], service, operator["name"]);
else
console.log("%s iku gak cocok: $o", phoneNumber, operator);
}
@agungf
agungf / gist:8803512
Created February 4, 2014 13:25
Remove passphrase (password) from private RSA key
Should also work for:
[v] any OpenSSH installation
Given, your key is in id_rsa
1
Passphrase is needed?
Try some host which has your public key (id_rsa.pub)
@agungf
agungf / dacast-snippet-web
Created February 27, 2017 12:00
Dacast player code snipper from web App
dacast(_vid_id,"vid_here");
_vid_player = dacast.players[_vid_id];
// console.log(_vid_player.play());
_vid_player.onReady(function(){
console.log('player ready');
// console.log('Step 2');
_vid_player.onPlay(function(){
// console.log('playing video');
@agungf
agungf / dacast-snippet-android
Created February 27, 2017 12:00
Dacast player code snipper from Android App
package com.ruangguru.livestudents.ui.onlinevideo;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
@agungf
agungf / dacast-snippet-ios
Created February 27, 2017 12:00
Dacast player code snipper from IOS App
@IBOutlet weak var videoWebView: UIWebView!
videoWebView.allowsInlineMediaPlayback = false
videoWebView.mediaPlaybackRequiresUserAction = true
videoWebView.scrollView.scrollEnabled = false
let videoURLString = String(format:"%@/%@?file_id=%@&ip=%@&ua=%@", RGConstant.Services.URL.videoBaseURL, RGConstant.Services.URL.Path.videoPlayer, fileIDVideo, ipAdress,userAgent)
let videoURL = NSURL(string: videoURLString)
let request = NSMutableURLRequest(URL: videoURL!)
if let token = TokenManager.sharedManager.getToken() {
Generating CSR
==============
openssl genrsa -des3 -out server.key 2048
openssl rsa -in server.key -out server.key.insecure
mv server.key server.key.secure
mv server.key.insecure server.key
openssl req -new -key server.key -out server.csr
install on apache
================
@agungf
agungf / strongloop re-install
Created December 16, 2013 09:20
unistalling strongloop deb package from rackspace server and installing the new version
1. removing the deb package: apt-get remove strongloop-suite
2. installing the new one:
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs
npm install -g strong-cli
[{"name":"speak","phrase":"Thanks for calling!"},
{"name":"playback","filename":"lots-o-monkeys"}]
@agungf
agungf / seo.md
Last active August 29, 2015 14:17 — forked from dypsilon/seo.md
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'