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
@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();
@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('',
@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>
@qerdcv
qerdcv / GetTotalContributinonsInGitlab.md
Created November 13, 2022 19:08
Get total count of contributions in gitlab for current year

Just paste it into the browser console, and it will count contributions for you.

Array.from(document.querySelectorAll(".user-contrib-cell")).reduce((acc, el) => (isNaN(+acc) ? 0 : acc) + (el.getAttribute("title").trim().split(" ").length > 1 && isNaN(+el.getAttribute("title").trim().split(" ")[0]) ? 0 : +el.getAttribute("title").trim().split(" ")[0]));
@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
<?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
*/
?>
@alegut
alegut / hide-am-pm.css
Created June 15, 2018 13:49
Hide AM/PM in input type="time"
input[type=time]::-webkit-datetime-edit-ampm-field {
display: none;
}
@bradtraversy
bradtraversy / scrapy.md
Last active December 1, 2024 20:34
Scrapy commands and code
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active December 23, 2024 15:56 — 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
@victorbruce
victorbruce / Firebase.md
Last active January 12, 2025 18:31
My journey with Firebase so far. Cheatsheet to serve as a quick reference when developing firebase applications

Firebase

Set up firebase and Deploy

  • Head over to firebase. Sign in and create a project.

  • Copy your project settings under Firebase SDK snippet into your local project (ie your project's api key, auth domain, databaseURL, etc)

  • Create a file (firebase.js or config.js Any name that suits you is fine)