Skip to content

Instantly share code, notes, and snippets.

@jamesdeantv
jamesdeantv / swipeableTabs.tsx
Created August 29, 2019 00:05 — forked from JCKodel/swipeableTabs.tsx
Hacky swipeable Ionic/Stencil tabs
import { Component } from "@stencil/core";
@Component({ tag: "page-tabs", styleUrl: "page-tabs.scss" })
export class PageTabs
{
private tabNames: Array<string>;
private slides: HTMLIonSlidesElement;
private tabs:HTMLIonTabsElement;
private getTabNames(tabs: HTMLIonTabsElement)
@jamesdeantv
jamesdeantv / fancy-transition.ts
Created August 28, 2019 21:54 — forked from BekirUzun/fancy-transition.ts
Ionic 3 custom page transitions: "slide-up" and "fancy"
import { Animation, PageTransition } from "ionic-angular";
import { isPresent } from "ionic-angular/util/util";
const EASINGS = {
outBack: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',
inOutCubic: 'cubic-bezier(0.645, 0.045, 0.355, 1)',
magnet: 'cubic-bezier(0.85, 0.06, 0.15, 0.94)'
}
const DURATION = 500;
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title>
Demo
</ion-title>
</ion-toolbar>
</ion-header>
= Some yum usage for people who know "apt" =
If you are familiar with the apt package manager on Debian/Ubuntu this page should help you transfer your knowledge to working with yum on Fedora/RHEL/CentOS/etc.
Note that this page as currently written is by non-apt experts, so there may be some mistakes.
== General points ==
* Speed:
* data/CPU: apt on Debian deals with roughly ~37,000 packages[1] and an extra 6,500 "provides"[2]. yum on Fedora deals with roughly 24,000 packages, 143,000 provides and 3,100,000 file provides.
@jamesdeantv
jamesdeantv / socket-emit-snippets.js
Created March 30, 2019 17:54
Socket.io Emit Snippets
io.on('connect', onConnect);
function onConnect(socket){
// sending to the client
socket.emit('hello', 'can you hear me?', 1, 2, 'abc');
// sending to all clients except sender
socket.broadcast.emit('broadcast', 'hello friends!');

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@jamesdeantv
jamesdeantv / app.js
Created March 24, 2019 19:36 — forked from jochasinga/app.js
Node/Socket.io server code for syncing data from Firebase
var Firebase = require("firebase");
var express = require("express");
// Create HTTP Server
var app = express();
var server = require("http").createServer(app);
// Attach Socket.io server
var io = require("socket.io")(server);
// Indicate port 3000 as host
var port = process.env.PORT || 3000;
@jamesdeantv
jamesdeantv / dabblet.css
Created February 17, 2019 03:05 — forked from LeaVerou/dabblet.css
Sprite Sheet animation with CSS3 using the steps() feature
/**
* Sprite Sheet animation with CSS3 using the steps() feature
* Simplified from simurai’s original example at http://jsfiddle.net/simurai/CGmCe/
*/
@keyframes wink {
from { background-position: 0px; }
to { background-position: -500px; }
}
@jamesdeantv
jamesdeantv / transitions.ts
Last active February 11, 2019 00:39
custom transitions
import { Animation, PageTransition } from 'ionic-angular';
/* ==================================================
Direct
================================================== */
export class ModalEnterDirect extends PageTransition {
public init() {
super.init();
const ele: HTMLElement = this.enteringView.pageRef().nativeElement;
##.ytp-pause-overlay
##.ytp-ce-covering-overlay
##.ytp-ce-element-shadow
##.ytp-ce-covering-image
##.ytp-ce-expanding-image