Skip to content

Instantly share code, notes, and snippets.

@yusn
yusn / test.sql
Created September 23, 2024 07:44
demo
hhhh
@yusn
yusn / mkfavicon.sh
Created September 8, 2017 07:35 — forked from pfig/mkfavicon.sh
Make a multi-resolution favicon.ico from a source image, using ImageMagick
#!/bin/bash
# from
# http://bergamini.org/computers/creating-favicon.ico-icon-files-with-imagemagick-convert.html
convert source-WxW.png -resize 256x256 -transparent white favicon-256.png
convert favicon-256.png -resize 16x16 favicon-16.png
convert favicon-256.png -resize 32x32 favicon-32.png
convert favicon-256.png -resize 64x64 favicon-64.png
convert favicon-256.png -resize 128x128 favicon-128.png
@yusn
yusn / nginx.conf
Created July 14, 2017 05:43 — forked from ivanionut/nginx.conf
Server portion for setting up a proxy to Lucee with rewrite to have index.cfm omitted for SES.
http {
...
server {
listen 80;
server_name example.com;
root /var/www/exmaple.com/www/;
index index.cfm;
set $lucee_context "example.com";
@yusn
yusn / deactivated.php
Created February 10, 2017 06:30 — forked from dcooney/deactivated.php
EDD Deactive function
<?php
function alm_prev_post_deactivate_license() {
// listen for our activate button to be clicked
if( isset( $_POST['alm_prev_post_license_deactivate'] ) ) {
// run a quick security check
if( ! check_admin_referer( 'alm_prev_post_license_nonce', 'alm_prev_post_license_nonce' ) )
return; // get out if we didn't click the Activate button
@yusn
yusn / event.php
Created February 10, 2017 06:29 — forked from dcooney/event.php
Event Listing Template
<li>
<?php if (has_post_thumbnail()) {
the_post_thumbnail(array(150,150));
}?>
<h3><a href="#"><?php the_title(); ?></a></h3>
<?php
$start_date = date("F j, Y", strtotime(get_field('start_date')));
$end_date = date("F j, Y", strtotime(get_field('end_date')));
?>
<p class="entry-meta">
@yusn
yusn / alm_before_container.php
Created February 10, 2017 06:29 — forked from dcooney/alm_before_container.php
alm_before_container
<?php
function my_custom_alm_before_container() {
return '<h2>Our Recent Work!</h2>';
}
add_filter( 'alm_before_container', 'my_custom_alm_before_container' );
@yusn
yusn / alm_after_container.php
Created February 10, 2017 06:29 — forked from dcooney/alm_after_container.php
alm_after_container
<?php
function my_custom_alm_after_container() {
return '<p><a href="/work">View All Work</a></p>';
}
add_filter( 'alm_after_container', 'my_custom_alm_after_container' );
@yusn
yusn / publish.php
Created February 10, 2017 05:10 — forked from octavian-filipciuc-work/publish.php
Delaying Posts in WordPress RSS Feed
function publish_later_on_feed($where) {
global $wpdb;
if ( is_feed() ) {
// timestamp in WP-format
$now = gmdate('Y-m-d H:i:s');
// value for wait; + device
$wait = '10'; // integer
@yusn
yusn / gist:76d91a8befa70fb0187b2427de4f5a92
Created January 11, 2017 06:39
A base for a functions.php for a WordPress theme
<?php
/**
* @package WordPress
* @subpackage Theme_Name
* @since Theme Name 1.0
*/
// replace "themename" with the theme slug
// load javascript on initialization
We couldn’t find that file to show.