Skip to content

Instantly share code, notes, and snippets.

View fvildoso's full-sized avatar
😋

Pipe Vildoso Castillo fvildoso

😋
View GitHub Profile
<?php
$data = (object)array(
"html" => "<foo bar=\"baz\"/> &amp;",
"arabic" => "العربية al-ʿarabiyyah, IPA: [æl ʕɑrɑˈbijjɐ], or عربي ʿarabī",
"hebrew" => "עִבְרִית, Ivrit",
"chinese" => "汉语/漢語 Hanyu; 华语/華語 Huáyǔ; 中文 Zhōngwén",
"korean" => "한국어/조선말",
"japanese" => "日本語 Nihongo",
"umlauts" => "äüöãáàß",
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@bryhal
bryhal / gist:4129042
Created November 22, 2012 02:08
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...
@samuraee
samuraee / application.php
Last active November 27, 2019 09:10
Environment based configuration for PhalconPHP (Production/Development/Staging)
<?php
// your main aplication config file
// app/config/application.php
$config = [
'application' => [
'cacheDir' => __DIR__ . '/../../cache/',
'appDir' => __DIR__ . '/../',
'baseUri' => '/',
'basePath' => '/',
'publicUrl' => 'http://www.your_domain.com',
@vergeev
vergeev / ReadYandexMailbox.java
Last active July 31, 2022 02:26
Opens mailbox on yandex.ru with IMAP, reads the last message and all unread ones.
import com.sun.mail.imap.IMAPMessage;
import java.util.Properties;
import javax.mail.Address;
import javax.mail.BodyPart;
import javax.mail.Flags;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.internet.MimeMultipart;
@mefarazath
mefarazath / GagSsl.java
Last active June 1, 2022 16:07 — forked from chalup/GagSsl.java
Get OkHttpClient which ignores all SSL errors.
private static OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain,
String authType) throws CertificateException {
}
@ijokarumawak
ijokarumawak / 0.NIFI_Example_CSV_JOIN.md
Last active January 15, 2024 02:31
NiFi example on how to join CSV files to create a merged result.

NiFi example on how to join CSV files to create a merged result

Let's say there're following 3 CSV files (a, b and c):

t, v
1, 10
2, 20
3, 30
4, 40
@ahmadawais
ahmadawais / upload-a-file.MD
Created June 18, 2017 11:07 — forked from websupporter/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@didibus
didibus / clojure-right-tool.md
Last active October 24, 2024 09:00
When is Clojure "the right tool for the job"?

My answer to: https://www.reddit.com/r/Clojure/comments/pcwypb/us_engineers_love_to_say_the_right_tool_for_the/ which asked to know when and at what is Clojure "the right tool for the job"?

My take is that in general, the right tool for the job actually doesn't matter that much when it comes to programming language.

There are only a few cases where the options of tools that can do a sufficiently good job at the task become limited.

That's why they are called: General-purpose programming languages, because they can be used generally for most use cases without issues.

Let's look at some of the dimensions that make a difference and what I think of Clojure for them:

@tatsuyasusukida
tatsuyasusukida / !README-javascript-svg-png.md
Last active October 4, 2024 19:04
🌅 How to convert SVG to PNG with JavaScript [video version available]

🌅 How to convert SVG to PNG with JavaScript [video version available]

Video thumbnail: How to convert SVG to PNG with JavaScript

About this article

This article describes how to convert SVG to PNG with frontend JavaScript. The related resources are as follows.