Skip to content

Instantly share code, notes, and snippets.

View AdrianBesleaga's full-sized avatar
🎯
Focusing

Adrian web AdrianBesleaga

🎯
Focusing
View GitHub Profile
@FreddieOliveira
FreddieOliveira / docker.md
Last active July 25, 2024 00:50
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@MarissaJ
MarissaJ / Line-break-control.js
Last active August 24, 2022 02:32
After Effects Data Driven Expression- Line Break Control
row = parseInt(thisComp.layer("Data-Sample.csv")("Data")("Number of Rows")-1);
thisComp.layer("Data-Sample.csv")("Data")("Outline")("Long Text")("Long Text " + row)
txt = thisComp.layer("Data-Sample.csv")("Data")("Outline")("Long Text")("Long Text " + row);
n = effect("Line Break")("Slider");
outStr = "";
newLine = "";
splt = txt.split(" ");
for (i = 0; i < splt.length; i++){
if ((newLine + " " + splt[i]).length > n){
@cdmatta
cdmatta / UndertowAccessLogApplication.java
Created April 12, 2018 21:13
Spring boot + Undertow access log, capture/record request processing time. Customize UndertowWebServerFactory
package io.cm.accesslog;
import io.undertow.Undertow;
import io.undertow.UndertowOptions;
import io.undertow.server.handlers.accesslog.AccessLogHandler;
import io.undertow.server.handlers.accesslog.AccessLogReceiver;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@dartiss
dartiss / functions.php
Last active October 23, 2018 11:32
List WordPress shortcodes
<?php
// Shortcodes to list all available shortcodes
function list_shortcodes() {
// Grab the global array of shortcodes
global $shortcode_tags;
// Sort the shortcodes into alphabetical order
@seco
seco / aws-afterfx-video.md
Created September 21, 2017 01:50
Setting up After Effects on AWS with Windows Server 2012

Setting up After Effects on AWS with Windows Server 2012

Hold on to your pants. This is a bit nuts.

Generating an Adobe After Effects installer:

  • Sign in to our Adobe Team account, go to 'Manage Team', download CCPLauncher.exe for windows.
  • This can be used to create a promptless installer for After FX.
  • Boot up a windows VM, preferably Windows 7 or newer.
  • Copy the CCPLauncher.exe to the VM's Desktop
  • Run the program. Follow the prompts in a windows box to generate the installer package.
@fffaraz
fffaraz / dns.c
Created May 29, 2016 05:58
DNS Query Code in C with linux sockets
//DNS Query Program on Linux
//Author : Silver Moon (m00n.silv3r@gmail.com)
//Dated : 29/4/2009
//Header Files
#include<stdio.h> //printf
#include<string.h> //strlen
#include<stdlib.h> //malloc
#include<sys/socket.h> //you know what this is for
#include<arpa/inet.h> //inet_addr , inet_ntoa , ntohs etc
@mmdemirbas
mmdemirbas / CombineIntoPDF.java
Last active August 17, 2023 10:38
Combine multiple images into a single PDF file using Apache PDFBox 2.0.1
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
@jchristopher
jchristopher / gist:ad99aa5a25eca6dbaf09
Last active November 21, 2017 20:04
Piggyback Yoast SEO's output of OpenGraph data to output Pinterest Rich Pin OpenGraph data for WooCommerce products
<?php
/**
* Piggyback Yoast SEO OpenGraph output to add Pinterest
* Rich Pin OpenGraph data for WooCommerce products
*/
add_filter( 'wpseo_opengraph_type', function( $og_type ) {
if ( 'product' == get_post_type() ) {
$og_type = 'product';
}
@hissy
hissy / gist:7352933
Created November 7, 2013 11:07
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,