Skip to content

Instantly share code, notes, and snippets.

View amin-ak's full-sized avatar
😉
im good

Amin Akmali amin-ak

😉
im good
View GitHub Profile
@jez500
jez500 / package.json
Created December 26, 2018 11:32
Simple Webpack 4 Compile SCSS to CSS config with autoprefix and minify
{
"name": "my-project",
"version": "1.0.0",
"description": "Simple SCSS complie with autoprefix and minify",
"scripts": {
"build": "webpack"
},
"devDependencies": {
"autoprefixer": "^9.0.0",
"breakpoint-sass": "^2.7.1",
@ingria
ingria / hellobot.php
Last active December 7, 2021 11:35
Simple PHP Telegram Bot
<?php
// @see https://core.telegram.org/bots/samples/hellobot
define('BOT_TOKEN', '12345678:replace-me-with-real-token');
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/');
function apiRequestWebhook($method, $parameters) {
if (!is_string($method)) {
error_log("Method name must be a string\n");
return false;
@tokopress
tokopress / style.css
Last active July 18, 2018 14:15
Bookie - Add background color overlay in slider
.toko-slider-wrap .toko-slides .toko-slide {
z-index: 1;
position: relative;
}
.toko-slider-wrap .toko-slides .toko-slide:before {
background-color: red;
opacity: 0.3;
position: absolute;
width: 100%;
height: 100%;
@ybagheri
ybagheri / answerInlineQuery.php
Last active December 20, 2018 14:13
Telegram inline bots answerInlineQuery Crawler
<?php
use Symfony\Component\DomCrawler\Crawler;
//.
//.
//.
if (isset($results->inline_query)) {
$inline_query = $results->inline_query;
$query_Id = $inline_query->id;
$query_Text = $inline_query->query;
@RadGH
RadGH / short-number-format.php
Last active April 9, 2024 11:28
Short Number Formatter for PHP (1000 to 1k; 1m; 1b; 1t)
<?php
// Converts a number into a short version, eg: 1000 -> 1k
// Based on: http://stackoverflow.com/a/4371114
function number_format_short( $n, $precision = 1 ) {
if ($n < 900) {
// 0 - 900
$n_format = number_format($n, $precision);
$suffix = '';
} else if ($n < 900000) {
<?php
/* wp_signon can only be executed before anything is outputed in the page because of that we're adding it to the init hook */
global $wppb_login;
$wppb_login = false;
function wppb_signon(){
global $error;
global $wppb_login;