Skip to content

Instantly share code, notes, and snippets.

View arisawali2014's full-sized avatar
💢
Depressed

Muhamad Ari Sawali arisawali2014

💢
Depressed
View GitHub Profile
@arisawali2014
arisawali2014 / telegraph.php
Last active September 30, 2024 15:58
Upload Image to Telegraph with Curl
<?php
public function uploadMedia($file)
{
$target_url = "https://telegra.ph/upload";
$file_name_with_full_path = $file;
if (function_exists('curl_file_create')) { // php 5.5+
$cFile = curl_file_create($file_name_with_full_path);
} else { //
$cFile = '@' . realpath($file_name_with_full_path);
@arisawali2014
arisawali2014 / RunScheduler.php
Created September 23, 2021 02:14 — forked from robbydooo/RunScheduler.php
Heroku Laravel Scheduler
<?php
/**
This Scheduler will run once every minute unlike the Heroku scheduler which only runs every 10 mintues.
To use this scheduler with Laravel 5.4+ add this file to /app/Console/Commands/RunScheduler.php
Register this file in app/Console/Kernel.php
@arisawali2014
arisawali2014 / removeNode.js
Last active June 23, 2021 04:29
Removing object item from array in javascript
var data = [
{id: "1", name: "Snatch", type: "crime"},
{id: "2", name: "Witches of Eastwick", type: "comedy"},
{id: "3", name: "X-Men", type: "action"},
{id: "4", name: "Ordinary People", type: "drama"},
{id: "5", name: "Billy Elliot", type: "drama"},
{id: "6", name: "Toy Story", type: "children"}
];
function RemoveNode(id) {
@arisawali2014
arisawali2014 / dtTableToCsv.vb
Created June 5, 2020 06:27
VB.Net DataTable to CSV
Private Function dtTableToCSV(dt As DataTable, filename As String, Optional headers As Boolean = True, Optional delim As String = ",")
Dim txt As String
Dim fileloc As String = filename + ".csv"
If File.Exists(fileloc) Then
File.Delete(fileloc)
End If
Dim n = 0
If headers = True Then
For Each column As DataColumn In dt.Columns
If n = 0 Then

Keybase proof

I hereby claim:

  • I am arisawali2014 on github.
  • I am arisawali2014 (https://keybase.io/arisawali2014) on keybase.
  • I have a public key ASC44SKcGs6rajkaguy8r2uLLFXY4XeLcoCnislLStzUEgo

To claim this, I am signing this object:

.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
max-width: 300px;
margin: auto;
text-align: center;
font-family: arial;
}
.title {
color: grey;
@arisawali2014
arisawali2014 / combine.py
Created April 28, 2018 06:56 — forked from glombard/combine.py
Merging 4 images into one with Python and PIL/Pillow
# Combine multiple images into one.
#
# To install the Pillow module on Mac OS X:
#
# $ xcode-select --install
# $ brew install libtiff libjpeg webp little-cms2
# $ pip install Pillow
#
from __future__ import print_function
<!DOCTYPE html>
<html>
<head>
<title>Python Flask - Cara Kode!</title>
</head>
<body>
<h1>Cara Kode!</h1>
<h2>Tempat asik belajar coding.</h2>
<a href='https://www.carakode.me/'>Cara kode!</a>
</body>
import flask
from flask import *
app = Flask(__name__)
@app.route('/')
def index():
return 'Cara Kode!'
if __name__ == '__main__':
diff --git a/lib/py/setup.py b/lib/py/setup.py
index c196415..61f8c44 100644
--- a/lib/py/setup.py
+++ b/lib/py/setup.py
@@ -64,7 +64,7 @@ def run_setup(with_binary):
)
else:
extensions = dict()
-
+