Skip to content

Instantly share code, notes, and snippets.

View ajmalafif's full-sized avatar
💻

Ajmal Afif ajmalafif

💻
View GitHub Profile
@cobyism
cobyism / gh-pages-deploy.md
Last active April 12, 2025 09:10
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@srobbin
srobbin / gist:5165332
Last active December 14, 2015 23:28
Fix for multiple backstretch DIVs on subsequent calls
/*
* Backstretch
* http://srobbin.com/jquery-plugins/backstretch/
*
* Copyright (c) 2012 Scott Robbin
* Licensed under the MIT license.
*/
;(function ($, window, undefined) {
'use strict';
@barneycarroll
barneycarroll / fileInput.css
Last active April 2, 2023 22:21
Total input[type=file] style control with pure CSS. File type inputs are notoriously hard to style, due to different semi-serious style restrictions in the name of security (the argument being that a file input presents access to the user's private file system, and should as such always look unambiguously like what it is — redundant if you ask m…
.fileContainer {
overflow: hidden;
position: relative;
}
.fileContainer [type=file] {
cursor: inherit;
display: block;
font-size: 999px;
filter: alpha(opacity=0);
@pocha
pocha / blogger-cum-techie-at-Codelearn
Last active December 16, 2015 04:29
Looking for Blogger cum Techie who wants to learn to code (rather learn cutting edge web technologies)
I am Ashish, founder of Codelearn (www.codelearn.org) - a website in online learning to code space. There are numerous other sites there (most notably Codecademy) in the space. We did not like the way they teach to code because most hackers do not intend to learn to code that way. Hackers prefer to learn by building real apps. That is how we picked up technologies too. So at Codelearn, we emulated the process.
The course/tutorial at Codelearn starts with suggestion of an app to build. The rest of the course then teaches the essentials & step by step building. To facilitate quick learning - a **real** application development environment is provided *inside the browser* . We call it Codelearn Playground & it is our main USP. The user can *actually* build an app inside Playground. He can continue to do so without needing to install on his PC. Forever.
So that was the rosy part. Now comes the not-so-rosy one. After running Codelearn for around 8 months, we realized that the newbies who want to learn to code,
@carolineschnapp
carolineschnapp / gist:5397337
Last active January 20, 2023 10:11
Sample JavaScript file added with ScriptTag resource. This sample file is meant to teach best practices. Your app will load jQuery if it's not defined. Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7.
/* Sample JavaScript file added with ScriptTag resource.
This sample file is meant to teach best practices.
Your app will load jQuery if it's not defined.
Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7.
Your app does not change the definition of $ or jQuery outside the app.
Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2'
once the app is installed, even if the app uses jQuery 1.9.1:
jQuery.fn.jquery => "1.4.2"
$.fn.jquery -> "1.4.2"
*/
@miry
miry / index.html
Created April 23, 2013 20:42
This is a simple Sinatra application with sample of cross domain sharing resource.
<html>
<head>
<title>
Demo Cross Domain
</title>
<!-- Le styles -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<style>
body {
@balupton
balupton / README.md
Last active April 29, 2019 11:57
DocPad: Use DocPad, GitHub & Prose as a Wiki

Use DocPad, GitHub and Prose as a Wiki

This guide will walk you through how you can use a GitHub repository to house your wiki content, have DocPad render it, and automatically update on changes. It's also really nice as we get to benefit from the github project workflow for our wiki, that is issues, pull requests, etc.

We use this workflow heavily by linking the DocPad Website and the DocPad Documentation repositories allowing us to have users edit and submit pull requests for improvements to our documentation, and once merged, the website regenerates automatically.

1. Create a new repository for your Wiki Content

@lukearmstrong
lukearmstrong / shopify-pagination.liquid.html
Last active December 6, 2023 00:41
Shopify - Show links to all pages in pagination, gets rid of the "..."
<div id="pagination">
<ul>
{% if paginate.previous %}
<li>{{ paginate.previous.title | link_to: paginate.previous.url }}</li>
{% endif %}
{% for i in (1..paginate.pages) %}
{% if paginate.current_page == i %}
<li>{{ i }}</li>
import json
import urllib
import urllib2
import time
""" Nike plus activity log
https://developer.nike.com
Output:
-- May --
@adamwiggins
adamwiggins / adams-heroku-values.md
Last active November 27, 2024 17:06
My Heroku values

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style