This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$singleton = get_class( | |
new class | |
{ | |
protected static $instance; | |
public static function getInstance() | |
{ | |
if (! isset(self::$instance)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jisho.org Support for Anki | |
import os, re, json, requests, urllib.request, urllib.parse | |
from aqt import gui_hooks | |
from aqt import mw | |
from aqt.qt import qconnect | |
from aqt.editor import Editor | |
from aqt.utils import showInfo | |
from anki.utils import stripHTML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add this to your filters.php file in a Sage 10 theme. | |
* It will look at "resources/views/core/{blockname}.blade.php | |
* and render the view with "block_content" and "block" as variables. | |
* | |
* You can also use View Composers built in Sage 10 to pass more | |
* data to the block as you wish. For ACF blocks, I recommend | |
* generoi/sage-acfblocks which is definitely the cleanest | |
* method to include ACF blocks in Sage 10 I found so far. |
Snippets frequently used with Sage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uninstall current version you want to downgrade | |
brew cask uninstall <PackageName> | |
# Edit Cask file | |
brew cask edit <PackageName> | |
# e.g. Vagrant | |
brew cask edit vagrant | |
``` | |
cask 'vagrant' do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class QueryBuilder { | |
const QUERY_SELECT = 1; | |
const QUERY_INSERT = 2; | |
const QUERY_UPDATE = 3; | |
const QUERY_DELETE = 4; | |
const QUERY_REPLACE = 5; | |
const PARAMETER_STRING = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# {{ ansible_managed }} | |
# nginx Configuration File | |
# http://wiki.nginx.org/Configuration | |
# Run as a less privileged user for security reasons. | |
user {{ nginx_user }}; | |
# How many worker threads to run; | |
# "auto" sets it to the number of CPU cores available in the system, and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( !class_exists('acf') ) | |
{ | |
$tp_acf_notice_msg = __( 'This website needs "Advanced Custom Fields Pro" to run. Please download and activate it', 'tp-notice-acf' ); | |
/* | |
* Admin notice | |
*/ | |
add_action( 'admin_notices', 'tp_notice_missing_acf' ); | |
function tp_notice_missing_acf() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
login | |
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Authorization: Password pppppwwwwdddd" -H "Accept-Language: en-us" --compressed https://cloud.culturedcode.com/version/1/account/user%40exmaple.com | |
get key | |
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Authorization: Password pppppwwwwdddd" -H "Accept-Language: en-us" --compressed https://cloud.culturedcode.com/version/1/account/user%40exmaple.com/own-history-keys | |
get index | |
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Accept-Language: en-us" --compressed https: |
NewerOlder