Skip to content

Instantly share code, notes, and snippets.

View theskyfloor's full-sized avatar

Alan Miller theskyfloor

View GitHub Profile
@lantins
lantins / macros.twig
Created October 31, 2014 13:05
Twig Macro Example --- Bootstrap
{% macro error_block(errors) %}
{% if errors %}
<span class="help-block">
<ul>
{% for err in errors %}
<li>{{ err }}</li>
{% endfor %}
</ul>
</span>
{% endif %}
@christopherhealey
christopherhealey / CSV Export of Fields
Last active August 29, 2015 14:22
Matrix+Supertable templates for Craft Cms based on Startup Framework (Bootstrap)
"id","groupId","name","handle","context","instructions","translatable","type","settings","dateCreated","dateUpdated","uid"
1,1,"Body","body","global","",0,"Matrix","{\"maxBlocks\":null}","2015-05-26 04:01:59","2015-06-04 14:14:26","f8c4fcfa-a054-4bca-8098-6f6572b536b6"
3,NULL,"Heading","heading","matrixBlockType:1","",0,"PlainText","{\"placeholder\":\"\",\"maxLength\":\"\",\"multiline\":\"\",\"initialRows\":\"4\"}","2015-05-27 10:18:33","2015-06-04 14:14:26","f3b2f9f2-e8ec-4261-95ee-7eb0f8994ac7"
4,NULL,"Text","text","matrixBlockType:1","",0,"RichText","{\"configFile\":\"\",\"cleanupHtml\":\"1\",\"purifyHtml\":\"\",\"columnType\":\"mediumtext\"}","2015-05-27 10:18:33","2015-06-04 14:14:26","9c3e5114-9edf-453f-9372-166f28e59eb3"
5,NULL,"Image","image","matrixBlockType:1","",0,"Assets","{\"useSingleFolder\":\"\",\"sources\":\"*\",\"defaultUploadLocationSource\":\"1\",\"defaultUploadLocationSubpath\":\"\",\"singleUploadLocationSource\":\"1\",\"singleUploadLocationSubpath\":\"\",\"restrictFiles\":\"1\",\"allowedK
@XuaTheGrate
XuaTheGrate / mute.py
Created April 16, 2019 09:23
Timed Mute for Latest Discord.py
"""
Updated for discord.py 1.0.x / Rewrite
Original credit goes to Vexs
"""
import discord
import asyncio
import re
from discord.ext import commands
import sys
@ethanclevenger91
ethanclevenger91 / after.sh
Last active May 24, 2024 15:24
Install PHP SQLSRV database extension on Laravel Homestead (probably works as a Laravel Forge recipe, too). Thanks @richvida
#!/bin/sh
PHP_MSSQL_DRIVERS=Ubuntu18-7.3
PHP_MSSQL_RELEASE=5.6.1
# Download and extract phpmysql drivers
sudo wget "https://github.com/Microsoft/msphpsql/releases/download/v${PHP_MSSQL_RELEASE}/${PHP_MSSQL_DRIVERS}.tar" -O - | tar -x
# Change Directory
cd $PHP_MSSQL_DRIVERS
@Linch1
Linch1 / tokenPriceApi.js
Last active June 23, 2024 12:49
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
let pancakeSwapAbi = [
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},
];
let tokenAbi = [
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},
];
const Web3 = require('web3');
/*
Required Node.js