Skip to content

Instantly share code, notes, and snippets.

View devded's full-sized avatar
🎯
Focusing

Dedar Alam devded

🎯
Focusing
  • Dhaka, Bagladesh
View GitHub Profile
<?php
echo file_get_contents('http://tinyurl.com/api-create.php?url='.'http://www.example.com/');
/* For example
http://tinyurl.com/api-create.php?url=http://www.fullondesign.co.uk/
Would return:
http://tinyurl.com/d4px9f
*/
?>
@mikeflynn
mikeflynn / gist:5887186
Last active July 10, 2022 23:26
Google Script: YouTube Channel Username to Channel ID
function ytChannelId(channelName) {
if(channelName) {
var name = getChannelFromUrl(channelName);
var url = "https://gdata.youtube.com/feeds/api/users/" + name + "?fields=id&alt=json";
var result = UrlFetchApp.fetch(url);
var data = Utilities.jsonParse(result.getContentText())
if(typeof data['entry'] !== 'undefined' && data['entry']['id']['$t'] !== 'undefined') {
var id = "UC" + data['entry']['id']['$t'].split('/').pop();
@danharper
danharper / background.js
Last active June 29, 2024 19:32
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@hijonathan
hijonathan / form.html
Last active August 1, 2023 19:14
Submit a HubSpot form with AJAX without redirecting the user.
<form class='form-inline' id='my-custom-form'>
<div class="form-group">
<input type='email' class='form-control' placeholder='Your email address' required>
</div>
<button class="btn btn-primary" type='submit'>Sign up</button>
</form>
<!-- Actual form that gets submitted to HubSpot -->
<div class="hidden" id='hubspot-form'>
<script charset="utf-8" src="//js.hsforms.net/forms/current.js"></script>
@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active March 26, 2024 01:21
A sample README for all your GitHub projects.

Repository Title Goes Here

Frances Coronel

INSERT GRAPHIC HERE (include hyperlink in image)

Subtitle or Short Description Goes Here

ideally one sentence >

@hezhao
hezhao / django_cmd.sh
Last active May 1, 2024 07:22
Django Commands Cheatsheet
# Use Python 3 for easy unicode
$ virtualenv -p python3 .env
$ source .env/bin/activate
$ pip install django
$ deactivate
# Start new django project and app
$ django-admin.py startproject mysite
$ ./manage.py migrate
$ ./manage.py createsuperuser
@parmentf
parmentf / GitCommitEmoji.md
Last active July 19, 2024 04:00
Git Commit message Emoji
@BastinRobin
BastinRobin / README.md
Created March 11, 2016 17:01
Django URL regex

Common Regular Expressions for Django URLs

A list of comman regular expressions for use in django url's regex.

Example Django URLs patterns:

urlpatterns = patterns('',
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active July 19, 2024 20:02 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment