Skip to content

Instantly share code, notes, and snippets.

View afbora's full-sized avatar
🎯
Focusing

Ahmet Bora afbora

🎯
Focusing
View GitHub Profile
@xavierfoucrier
xavierfoucrier / gpg-signing.md
Last active May 4, 2024 03:16
GPG signing with Git and Github Desktop

GPG signing – git github-desktop

Here is a short guide that will help you setup your environment to create signed commits or signed tags with Git locally. This has been extensively tested on Windows with Git and the Github Desktop application: I use it every day for my professional development projects.

I you face any issue, feel free to leave a comment below.

Summary

  1. Sign commits or tags
  2. Key passphrase
  3. Disable signatures
  4. Renew a GPG key
@paulochf
paulochf / countries.sql
Last active April 26, 2024 09:50 — forked from adhipg/countries.sql
Outdated. Used with discretion. Accepting updates.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@jwage
jwage / SplClassLoader.php
Last active April 9, 2024 21:04
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@fomightez
fomightez / remove blank lines regex.md
Last active February 22, 2024 09:49
remove all blank lines using regular expressions
@eusonlito
eusonlito / foldersize.php
Last active July 25, 2023 12:50
PHP function to get the folder size including subfolders
<?php
function folderSize ($dir)
{
$size = 0;
foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {
$size += is_file($each) ? filesize($each) : folderSize($each);
}
@waaronking
waaronking / index.vue
Created June 23, 2020 10:44
TipTap Align-Text Example
<!-- This file is mainly pseudo code with parts copied from a working project to illustrate how tiptap-aligntext.plugin.js can be implemented into your project -->
<template>
<div>
<editor-menu-bar :editor="editor" v-slot="{ commands }">
<div class="menubar">
<i class="fas fa-align-left" :class="{ 'is-active': editor.activeMarkAttrs.aligntext.align === 'left' }" @click="commands.aligntext({ align: 'left' })"></i>
<i class="fas fa-align-center" :class="{ 'is-active': editor.activeMarkAttrs.aligntext.align === 'center' }" @click="commands.aligntext({ align: 'center' })"></i>
<i class="fas fa-align-right" :class="{ 'is-active': editor.activeMarkAttrs.aligntext.align === 'right' }" @click="commands.aligntext({ align: 'right' })"></i>
<i class="fas fa-align-justify" :class="{ 'is-active': editor.activeMarkAttrs.aligntext.align === 'justify' }" @click="commands.aligntext({ align: 'justify' })"></i>
@flokosiol
flokosiol / getkirby-panel-save-button-fixed.css
Last active September 8, 2020 09:52
Fixes the Kirby (getkirby.com) panel topbar and the save button at the top of the browser window.
/*
Fixes the Kirby (getkirby.com) panel topbar and the save button at the top of the browser window.
Put this css snippet in your assets/css/panel.css file and add the following to your site/config/config.php
c::set('panel.stylesheet', 'assets/css/panel.css');
@see: http://forum.getkirby.com/t/move-the-save-button/1867/11?u=flokosiol
*/
.topbar {
position: fixed;
@bastianallgeier
bastianallgeier / controllers--contact.php
Created October 1, 2014 19:36
Plain contactform example for Kirby 2
<?php
return function($site, $pages, $page) {
$alert = null;
if(get('submit')) {
$data = array(
'name' => get('name'),
@afbora
afbora / .htaccess
Last active June 16, 2019 18:49
Amazing htaccess with cache resources
# Amazing .htaccess
# Requires Following Modules Enabled
# mod_rewrite
# mod_deflate
# mod_headers
# mod_mime
# mod_expires
# rewrite rules