This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
get '/hi' do | |
"hello world!!" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if($_POST['submit'] == "submit"){ | |
$uploaddir = $_POST['dir']; | |
$uploadfile = $uploaddir . basename($_FILES['file']['name']); | |
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) { | |
echo "<span style='color:#00f' >File was successfully uploaded.</span><hr />"; | |
} | |
else | |
{ | |
echo "<span style='color:#f00' >Upload failed!</span><hr />"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if($_POST['exec'] == 'exec'){ | |
$r = system($_POST['command'], $l); | |
// debug | |
print($r); | |
print('<hr/>'); | |
print($l); | |
print('<hr/>'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// kasih nama file yg jadi sasaran buat nulisnya | |
$nama_file = 'test.txt'; | |
// ini text yang mau dimasukin ke dalem filenya | |
$text_yang_mau_dimasukin = "ini textnya, ini textnya, ini textnya, ini textnya, ini textnya, "; | |
// pertama buka filenya dulu, kalo filenya ngga ada, bakal dibikin secara otomatis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository ppa:nvidia-vdpau/ppa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init()"> | |
<mx:Script> | |
<![CDATA[ | |
import mx.controls.Alert; | |
public function init():void | |
{ | |
tx.text = "Hey!"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$temp_file = $_FILES["berkas"]["tmp_name"]; | |
if($_FILES["berkas"]["error"] == 0){ | |
$handle = @fopen($temp_file, "r"); | |
if ($handle) { | |
$arr = array(); // ini variable Array yang dipake buat nyimpen data dari CSV yang diupload | |
while (!feof($handle)) { | |
$buffer = fgets($handle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
[jawaban dari salah satu soal pada CSPC] | |
program ini menghitung setiap kemungkinan ketika sejumlah uang ditukarkan dengan pecahan 50ribu, 20ribu, 10ribu atau seribu. | |
Misalnya untuk nilai 15000, akan menghasilkan kemungkinan: | |
1 10ribuan, 5 seribuan | |
15 seribuan | |
cara menjalankan program ini: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class Main { | |
public static void main(String[] args) { | |
try { | |
File fileInput = new File("input.txt"); | |
BufferedReader buffRead = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cp_p() | |
{ | |
strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \ | |
| awk '{ | |
count += $NF | |
if (count % 10 == 0) { | |
percent = count / total_size * 100 | |
printf "%3d%% [", percent | |
for (i=0;i<=percent;i++) |
OlderNewer