Skip to content

Instantly share code, notes, and snippets.

View therbta's full-sized avatar
🎯
Focusing

Baris Taskiran therbta

🎯
Focusing
  • VT, United States
  • 20:51 (UTC -04:00)
  • X @therbta
View GitHub Profile
@pavankjadda
pavankjadda / How to fix gitignore not working issue.md
Last active May 2, 2024 12:10
How to fix "gitignore not working" issue

FYI: Created blog post with more details

How to fix ".gitignore not working" issue?

Sometimes git does not exclude files/folders added .gitignore especially if you had commited them before. Here is how to fix it. I am ignoring node_modules from Angular project as an example

  1. Update .gitignore with the folder/file name you want to ignore. You can use anyone of the formats mentioned below (prefer format1)
### Format1  ###
node_modules/
@matheuseduardo
matheuseduardo / base64.inc.asp
Created July 12, 2018 18:50
Base64 encoding / decoding functions in VbScript / Classic ASP
<%
Function Base64Encode(sText)
Dim oXML, oNode
Set oXML = CreateObject("Msxml2.DOMDocument.3.0")
Set oNode = oXML.CreateElement("base64")
oNode.dataType = "bin.base64"
oNode.nodeTypedValue = Stream_StringToBinary(sText)
Base64Encode = oNode.text
Set oNode = Nothing
Set oXML = Nothing
@keithweaver
keithweaver / put-object-on-aws-s3.php
Last active May 18, 2023 19:20
Upload an image/object to an AWS S3 Bucket using PHP
<?php
// Installed the need packages with Composer by running:
// $ composer require aws/aws-sdk-php
$filePath = "https://example.com/test.png";
require 'vendor/autoload.php';
$bucketName = 'YOUR_BUCKET_NAME';
$filePath = './YOUR_FILE_NAME.png';
@mfd
mfd / _sanfrancisco-font.md
Last active May 4, 2024 22:33
San Francisco Web Font

Web fonts

Custom webfonts

https://gist.githubusercontent.com/mfd/614e2e80a22b878bde63cb471cbe677e/raw/4996edf5eb9aea434e0cbdc81923fb110a29d060/sanfrancisco-font.css

<link rel="stylesheet prefetch" href="https://gist.githubusercontent.com/mfd/614e2e80a22b878bde63cb471cbe677e/raw/eef2aabfd0d588d43285431186a0cf70305ceb80/sanfrancisco-font.css">

@oxguy3
oxguy3 / deploy.php
Last active August 5, 2023 20:21
Script used to automatically deploy from GitHub to a cPanel shared hosting server
<?php
/**
* deploy.php by Hayden Schiff (oxguy3)
* Available at https://gist.github.com/oxguy3/70ea582d951d4b0f78edec282a2bebf9
*
* No rights reserved. Dedicated to public domain via CC0 1.0 Universal.
* See https://creativecommons.org/publicdomain/zero/1.0/ for terms.
*/
// random string of characters; must match the "Secret" defined in your GitHub webhook
@taninbkk
taninbkk / functions.php
Last active November 1, 2023 07:55
Polylang Shortcode
// Polylang Shortcode - https://wordpress.org/plugins/polylang/
// Add this code in your functions.php
// Put shortcode [polylang] to post/page for display flags
function polylang_shortcode() {
ob_start();
pll_the_languages(array('show_flags'=>1,'show_names'=>0));
$flags = ob_get_clean();
return $flags;
}
@sparkweb
sparkweb / gist:c6a5a21ab44a23589b9c
Last active September 18, 2021 15:54
Order Desk PHP Client
<?php
class OrderDeskApiClient
{
private $store_id;
private $api_key;
private $base_url = "https://app.orderdesk.me/api/v2";
public $last_status_code = "";
public function __construct($store_id, $api_key) {
@asugai
asugai / Install composer on Amazon AMI running on EC2
Last active March 22, 2024 03:37
Install composer on Amazon AMI running on EC2
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@incredimike
incredimike / variousCountryListFormats.js
Last active April 30, 2024 11:10
List of Countries in various Javascript data structures: Alphabetical country lists & Country data objects.
// Lists of countries with ISO 3166 codes, presented in various formats.
// Last Updated: July 30, 2020
// If you're using PHP, I suggest checking out:
// https://github.com/thephpleague/iso3166
// or Laravel: https://github.com/squirephp/squire
//
// JS developers can check out:
// https://www.npmjs.com/package/iso3166-2-db
//