Skip to content

Instantly share code, notes, and snippets.

View oldmill1's full-sized avatar
🎯
Working

Ankur Taxali oldmill1

🎯
Working
View GitHub Profile
import $ from "jquery";
const username = "ankurtaxali";
$.getJSON({
url: `users/${username}/likes.json`,
success: books => {
books.forEach(book => {
$.getJSON({
url: `books/${book.id}.json`,
import $ from "jquery";
const username = "ankurtaxali";
$.getJSON({
url: `users/${username}/likes.json`,
success: books => {
books.forEach(book => {
$.getJSON({
url: `books/${book.id}.json`,
import $ from "jquery";
const username = "ankurtaxali";
$.getJSON({
url: `users/${username}/likes.json`,
success: books => {
books.forEach(book => {
$.getJSON({
url: `books/${book.id}.json`,
[{
id: "harry-potter",
}, {
id: "lord-of-the-rings",
}, {
id: "brave-new-world"
}]
import $ from "jquery";
const username = "ankurtaxali";
$.getJSON({
url: `users/${username}/likes.json`,
success: books => {
console.log(books);
}
});
[{
"name": "Nutri-Fries with Shredded Chicken",
"resource": {
"url": "https://www.instagram.com/p/BO3JlyHgX-x/"
},
"description": "Hi, it's Nan and Nicole from @wholesisters. Today we are sharing one of the most frequently requested meals in our family! These are a hit and a perfect addition in our Whole30 line up!",
"ingredients": [{
"name": "Sweet Potatoes",
"code": "SWEET_POTATOES",
"qty": "2",
@oldmill1
oldmill1 / Denominatios Problem
Last active August 29, 2015 13:56
Solves the denominations problems.
$denominations = array(0.5, 1, 2);
$total = 3.6;
for ($i = $total; $i > 0; $i = $i - $denominations[count($denominations)-1]) {
while ( $i < end($denominations) ){
unset($denominations[count($denominations)-1]);
}
if (empty($denominations)){
break;
In late 2009, I received an email from a guy asking to meet about his new project. I was a designer at the time, and he was looking for some advice, so I agreed to meet with him at the quintessential startup meeting place in San Francisco, The Creamery.
“I want to make an app for browsing catalogs. It's like a fashion catalog, but you can organize and share outfits,” he said. He pulled out his iPhone and showed me a prototype that barely worked. The UI was decent but clunky; it had side-swiping navigation that only worked every few swipes. He showed me what seemed to be an endless series of women's dresses. “Nice,” I said. But I had already dismissed the idea. How on Earth would this 20-something guy in Silicon Valley reach his target market of middle aged women? And would they even want such a thing? Did they even own iPhones? I think I asked a series of questions, but I don't even remember the answers.
“What a stupid idea,” I thought to myself.
As we finished our coffees, I think he sensed my apathy, and
@oldmill1
oldmill1 / trouble.php
Created April 11, 2013 15:48
Common Wordpress Problems
This is a list of common problems. Troubleshoot if you get desperate.
1. Pagination is not working.
No, pagination is working _fine_. It is _you_ that is not working.
a. declare the page variable above the loop.
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
b. use that variable in the loop
query_posts(array('post_type' => array('reviews', 'post'), 'paged' => $paged, 'posts_per_page' => 5));
@oldmill1
oldmill1 / hash4.php
Created March 23, 2013 03:02
code for hash4
<?php
// ==========================================
// Welcome to hash4 - a conventional flat-file blogging system
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
define("ROOT_URL", "localhost/hash4/");
define("SITE_TAG", "And did I say you look amazing?");
?>