Skip to content

Instantly share code, notes, and snippets.

ando dre1080

Block or report user

Report or block dre1080

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dre1080 /
Created Mar 5, 2018 — forked from samrocketman/
On Ubuntu 16.04, since iOS 10 update, libimobiledevice can't connect to my iPhone. This is my attempt to document a fix.

Why this document?

I upgraded my iPhone 5s to iOS 10 and could no longer retrieve photos from it. This was unacceptable for me so I worked at achieving retrieving my photos. This document is my story (on Ubuntu 16.04).

The solution is to compile libimobiledevice and ifuse from source.


Who is this guide intended for?

dre1080 / api.php
Created May 16, 2017
Disable WordPress REST API endpoints
View api.php
// Remove init rest routes
remove_action( 'rest_api_init', 'create_initial_rest_routes', 0 );
// Remove oembed rest routes
function remove_json_api () {
// Remove the REST API lines from the HTML Header
remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 );
dre1080 /
Last active Apr 18, 2020 — forked from marek-saji/
Configure local DNS server to serve *.localhost domains

Configure local wildcard DNS server

  1. Install Dnsmasq: sudo apt-get install dnsmasq

  2. Since Ubuntu's NetworkManager uses dnsmasq, and since that messes things up a little for us, open up /etc/NetworkManager/NetworkManager.conf and comment out (#) the line that reads dns=dnsmasq. Restart NetworkManager afterwards: sudo systemctl restart NetworkManager.

  3. Make sure Dnsmasq listens to local DNS queries by editing /etc/dnsmasq.conf, and adding the line listen-address=

dre1080 / soft-delete.sql
Last active Feb 10, 2016
Soft-deletable records in Postgres
View soft-delete.sql
CREATE FUNCTION soft_delete()
RETURNS trigger AS $$
|| ' SET deleted_at = current_timestamp WHERE id = $1'
$$ LANGUAGE plpgsql
dre1080 / util.go
Last active Sep 30, 2015
Print Echo registered routes
View util.go
package util
import (
// DebugPrintRoutes prints all registered routes of e.
View box-shadow.html
<!DOCTYPE html>
<title>Box Shadow</title>
.box {
height: 150px;
width: 300px;
margin: 20px;
View database.rake
require 'yaml'
require 'logger'
require 'active_record'
namespace :db do
def create_database config
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'}
create_db = lambda do |config|
ActiveRecord::Base.establish_connection config.merge('database' => nil)
dre1080 /
Created Nov 9, 2013
Js2Coffee a directory recursively. Excludes node_modules, app/assets and public directories.
for FILE in `find . -name "*.js" -type f -o -path './node_modules' -prune -o -path './app/assets' -prune -o -path './public' -prune`
if [ -e $FILE ] ; then
echo "converting ${FILE} to ${COFFEE}"
js2coffee "$FILE" > "$COFFEE"
echo "File: {$1} does not exist!"
View pesapal.rb
module PesaPal
require 'active_support'
include ActiveSupport::Configurable
self.configure do |config|
config.test_mode = true
config.consumer_key = "<your key>"
config.consumer_secret = "<your secret>"
You can’t perform that action at this time.