Skip to content

Instantly share code, notes, and snippets.

View dgarcia360's full-sized avatar

David Garcia dgarcia360

View GitHub Profile
@philipdowner
philipdowner / modify_archive_title.php
Created October 4, 2011 23:58
Modify the title tag of a WordPress custom post type archive
<?php
add_filter('wp_title', 'archive_titles');
/**
* Modify <title> if on an archive page.
*
* @author Philip Downer <philip@manifestbozeman.com>
* @link http://manifestbozeman.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version v1.0
*
@santazhang
santazhang / install_ffmpeg.py
Created March 4, 2012 07:55
Python script to compile and install ffmpeg
#!/usr/bin/env python
#
# Python script to compile and install ffmpeg.
#
# part of ffcluster project.
# see full project at github.com/santazhang/ffcluster
#
# Author: Santa Zhang <santa1987@gmail.com>
import os
@ghinda
ghinda / git-commit-csv-export.sh
Last active July 30, 2024 13:46
git csv export of commits in the last month
git log --since='last month' --pretty=format:'%h;%an;%ad;%s' --author='Ionut Colceriu' > ~/log.csv
@joshuacharleslake
joshuacharleslake / wordpress-disqus-shortcode.php
Last active November 16, 2020 05:08
Add Shortcode for disqus embed.
function disqus_embed($disqus_shortname) {
global $post;
wp_enqueue_script('disqus_embed','http://'.$disqus_shortname.'.disqus.com/embed.js');
echo '<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = "'.$disqus_shortname.'";
var disqus_title = "'.$post->post_title.'";
var disqus_url = "'.get_permalink($post->ID).'";
var disqus_identifier = "'.$disqus_shortname.'-'.$post->ID.'";
</script>';
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active July 25, 2024 19:20
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

import {
NetworkType,
ReceiptHttp,
UInt64
} from 'nem2-sdk';
import {sha3_256} from 'js-sha3';
(async () => {
const receiptHttp = new ReceiptHttp(
@rohit-gohri
rohit-gohri / Redocusaurus.jsx
Last active June 20, 2023 21:51
Redocusaurus: Reodc for use with Docusaurus V2, MOVED TO https://github.com/rohit-gohri/redocusaurus
import React from 'react';
import merge from 'lodash.merge';
import { RedocStandalone } from 'redoc';
import useThemeContext from '@theme/hooks/useThemeContext';
import './styles.css';
/**
* NOTE: Colors taken from `node_modules/infima/styles/common/dark-mode.css`
* and related files
*/
@pydanny
pydanny / response-to-abusive-customer.md
Last active August 2, 2020 21:50
Within 12 hours of sending this email I got an apology. Sometimes it's better to write this out than quickly fire a customer.

There is nothing wrong in wanting to feed our families.

If I wanted to profit, I would stop selling digital versions of our books and only do printed versions. The last time we did that was for Two Scoops of Django 1.6, which made more than 1.5, 1.8, and 1.11 combined. That's the only way to put a halt to digital piracy: don't sell digital works. But that denies people in a lot of places access to our works. And means we're about pedagogy over profit.

We give hundreds of unpaid hours per year to open source projects. For years, every single book we've released we've given hundreds of print copies away as charity. Through books, articles, and open source contributions we have furthered people's knowledge around the world for over a decade.

All this means we're running a charity for the Python and Django community. These live classes are our means to hopefully do open source work for a living, with a few classes per month to cover our bills.

Can we make more money building apps for other people? Absolutely