Skip to content

Instantly share code, notes, and snippets.

View defrindr's full-sized avatar
👋
Hi there

Defri Indra Mahardika defrindr

👋
Hi there
View GitHub Profile

Problem

A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:

$e^{i \pi} = -1$

Unfortunately, GitHub does not support inline formulas. The issue is tracked here.

Investigation

@defrindr
defrindr / updatefile.sh
Created April 29, 2020 12:14 — forked from aborruso/updatefile.sh
How to update a file in github via cURL
#!/bin/bash
cartella="/var/myfolder"
# update the file
curl -i -X PUT -H 'Authorization: token 4d013330xxxxxxxxxxxxxx' -d "{\"path\": \"mattei.csv\", \
\"message\": \"update\", \"content\": \"$(openssl base64 -A -in $cartella/mattei.csv)\", \"branch\": \"master\",\
\"sha\": $(curl -X GET https://api.github.com/repos/username/repo/contents/mattei.csv | jq .sha)}" \
https://api.github.com/repos/username/repo/contents/mattei.csv
@defrindr
defrindr / ZoomLayout.java
Created April 3, 2020 05:25 — forked from anorth/ZoomLayout.java
Pinch-zoomable Android frame layout
package au.id.alexn;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.widget.FrameLayout;
@defrindr
defrindr / hitung_kpr.js
Created March 21, 2020 09:14 — forked from ucay/hitung_kpr.js
[Javascript Function] Hitung KPR
function pmt(rate_per_period, number_of_payments, present_value, future_value, type){
if(rate_per_period != 0.0){
// Interest rate exists
var q = Math.pow(1 + rate_per_period, number_of_payments);
return -(rate_per_period * (future_value + (q * present_value))) / ((-1 + q) * (1 + rate_per_period * (type)));
} else if(number_of_payments != 0.0){
// No interest rate, but number of payments exists
return -(future_value + present_value) / number_of_payments;
}
@defrindr
defrindr / shadow.xml
Created February 1, 2020 13:41 — forked from lecho/shadow.xml
Android shadow drawable xml.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Drop Shadow Stack -->
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
@defrindr
defrindr / .htaccess
Created November 16, 2019 00:39 — forked from lynt-smitka/.htaccess
Block hidden files except .well-known - Apache .htaccess + Nginx
RewriteRule "(^|/)\.(?!well-known\/)" - [F]
@defrindr
defrindr / README.md
Created November 11, 2019 20:39 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@defrindr
defrindr / README.md
Created March 12, 2019 21:45 — forked from macagua/README.md
Install a Bower package with Composer configuration for Yii2 project

Install Bower packages with Composer configuration for Yii2 project

Install two (02) Bower packages like jquery 2.2.4 and pickadate 3.5.6 with Composer configuration for Yii2 project

Installing Composer

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
@defrindr
defrindr / spintax.php
Created March 12, 2019 07:24 — forked from irazasyed/spintax.php
PHP: Text Spinner Class - Nested spinning supported.
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
* @name Spintax
* @author Jason Davis - https://www.codedevelopr.com/
* Tutorial: https://www.codedevelopr.com/articles/php-spintax-class/
*/
class Spintax
{
public function process($text)
@defrindr
defrindr / output.txt
Created March 5, 2019 21:44 — forked from stamparm/output.txt
Sample sqlmap run
$ python sqlmap.py -u "http://192.168.21.128/sqlmap/mysql/get_int.php?id=1" -z "ign,flu,bat" --banner -f
sqlmap/1.0-dev-7614c81 - automatic SQL injection and database takeover tool
http://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting at 10:30:49
[10:30:49] [INFO] testing connection to the target url