Skip to content

Instantly share code, notes, and snippets.

View Yogatopia's full-sized avatar
👨‍💻
Coding

Armand Lacle Yogatopia

👨‍💻
Coding
  • Armandlacle.com
  • The Hague, Netherlands
View GitHub Profile
@Yogatopia
Yogatopia / wp-snippets.php
Created January 26, 2012 16:18 — forked from matiskay/wp-snippets.php
Wordpress Snippets Functions
<?php
// http://johnford.is/programmatically-pull-attachments-from-wordpress-posts/
// http://www.wprecipes.com/how-to-show-wordpress-post-attachments
// get all of the images attached to the current post
function _get_images($size = 'thumbnail') {
global $post;
$photos = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') );
var count = 2; // How many photos do you wanna display
var igToken = "371393934.dba0291.7da640d4c8fc4ff3a205f2e290eae6f1"; // DON'T USE MY ACCESS TOKEN. Generate your own, http://instagram.com/developer
var igUserId = "371393934"; // This is easy to generate, I've made a thing http://themes.edada.ms/instagram-auth
$.ajax({
url: 'https://api.instagram.com/v1/users/'+igUserId+'/media/recent/?access_token='+igToken+'&callback=?',
data: {
'count': count
},
dataType: "jsonp",

##Getting Started with Ionic Framework

Ionic is a powerful, beautiful and easy to use open source front-end framework built on top of AngularJs (a client side javascript framework), Sass Syntactically Awesome Style Sheets Apache Cordova for and developing hybrid (cross platform) mobile apps.

Ionic's ultimate goal is to make it easier to develop native mobile apps with HTML5, also known as Hybrid apps.

Install nodejs: http://nodejs.org/

    npm install -g cordova ionic
<?php
/**
* Duplicate this file as many times as you would like, just be sure to change the
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
<?php
// check if the flexible content field has rows of data
if( have_rows('blog_content') ):
// loop through the rows of data
while ( have_rows('blog_content') ) : the_row();
if( get_row_layout() == 'image_title_content' ):
@Yogatopia
Yogatopia / index.html
Created April 28, 2015 12:15
Fundation 5 Basic CDN Setup
<!DOCTYPE html>
<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]-->
<html class="no-js" lang="en" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Foundation 5</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.1/css/normalize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.1/css/foundation.min.css">
@Yogatopia
Yogatopia / 2_keyboard_shortcuts.md
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.

Create documentation for your projects. Like so:


Most popular keyboard shortcuts within GistBox

  • Up/Down - Previous/Next Gist
  • Ctrl+e - Edit a selected Gist
  • Ctrl+s - Save Gist
@Yogatopia
Yogatopia / onbeforeunload-1.js
Created June 1, 2015 09:43
Confirmation on Leaving the Current Page in JavaScript
function goodbye(e) {
if(!e) e = window.event;
//e.cancelBubble is supported by IE - this will kill the bubbling process.
e.cancelBubble = true;
e.returnValue = 'You sure you want to leave?'; //This is displayed on the dialog
//e.stopPropagation works in Firefox.
if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
@Yogatopia
Yogatopia / Intervals.py
Created July 4, 2015 13:17
Python Snippets
import threading
def do_every (interval, worker_func, iterations = 0):
if iterations != 1:
threading.Timer (
interval,
do_every, [interval, worker_func, 0 if iterations == 0 else iterations-1]
).start ()
worker_func ()