Skip to content

Instantly share code, notes, and snippets.

View annielagang's full-sized avatar

Annielyn May Lagang annielagang

  • Cavite, Philippines
View GitHub Profile
@abhiomkar
abhiomkar / youtube-downloadr-oneliner.py
Created May 12, 2010 13:50
One-liner to download youtube video in Python
# Author: Abhinay Omkar
# Title: One-liner to download youtube video in Python
from urllib import urlopen, unquote; from urlparse import parse_qs, urlparse; youtube_watchurl="http://www.youtube.com/watch?v=NeSuirvA6UE&playnext_from=TL&videos=MS3Hq4oBj08"; video_id = parse_qs(urlparse(youtube_watchurl).query)['v'][0]; open(video_id+'.mp4', 'wb').write(urlopen("http://www.youtube.com/get_video?video_id=%s&t=%s&fmt=18"%(video_id, parse_qs(unquote(urlopen('http://www.youtube.com/get_video_info?&video_id=' + video_id).read().decode('utf-8')))['token'][0])).read())
@zenorocha
zenorocha / README.md
Last active May 28, 2024 08:23
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@dmalikov
dmalikov / build.sm
Last active May 17, 2020 20:23
Programming Languages assignment 1 (with smbt and qcheck)
target hw1
sources
hw1.mlb
hw1.main.sml
end
option compiler = mlton
option output = hw1
end
@edalorzo
edalorzo / Example.cs
Last active December 14, 2015 02:39
C# Infinite Streams
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CodeMasters
{
class Program
{
@CaglarGonul
CaglarGonul / remdup.sml
Last active December 15, 2015 09:09
A simple ML algorithm for removing duplicates in a list is given below :
fun remove_duplicates (xs) =
case xs of
[]=>[]
| x::xs' => if List.exists (fn y=> x=y) xs'
then remove_duplicates (xs')
else x::remove_duplicates (xs')
val test_remove_duplicates = remove_duplicates ([3,3,3,3,5,5,5,5,6,6,6,6,7])
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace SomeNamespace
{
/// <summary>
/// Check and report multiple conditions in unit tests.
///
@DinoChiesa
DinoChiesa / Embedding-Gist.htm
Created May 22, 2013 02:24
Embed a Gist using jQuery.
<link href="http://yandex.st/highlightjs/7.0/styles/default.min.css" rel="stylesheet">
<script src="http://yandex.st/highlightjs/7.0/highlight.min.js"></script>
<script type='text/javascript'> $(document).ready(function() {
function fixup(s) {
var re1 = new RegExp('<','g'), re2 = new RegExp('>','g');
return s.replace(re1,'&lt;').replace(re2,'&gt;');
}
$.ajax({type: "GET",
url: "https://api.github.com/gists/5617520",
@Joev-
Joev- / DialogFragmentCallback.md
Last active June 25, 2021 08:43
Getting results from DialogFragment to calling Fragment using Callbacks

##Getting results from DialogFragments to another Fragment.

When setting up the DialogFragment make a call to Fragment.setTargetFragment()
Then from DialogFragment you can access the main fragment with Fragment.getTargetFragment()
Use interfaces to provide the required actions to the calling Fragment.

##Example code.

###AddFriendDialogFragment - Calls back to calling fragment.

@edalorzo
edalorzo / Streams.sml
Last active April 19, 2020 19:17
Stream Implementation in SML
datatype 'a stream = Empty | Cons of 'a * (unit -> 'a stream)
fun from n = Cons(n, fn () => from(n +1))
fun takeWhile f xs =
case xs of
Empty => Empty
| Cons(h,t) => if not(f(h))
then Empty
else Cons(h, fn () => takeWhile f (t()))
@berstend
berstend / LinkedOut.js
Last active November 2, 2022 23:28
Withdraw all pending invitations from LinkedIn automatically in bulk. - Or "How I stopped spamming all of my contacts with invitations". This script is super ugly (like what LinkedIn does with your email data) but worked for me. Usage: - Go to https://www.linkedin.com/inbox/invitations/sent - Open DevInspector, paste the script to the console, h…
var INCR = 16; // Number of messages per page
var SENT_URL = '//www.linkedin.com/inbox/invitations/sent?startRow=';
var loMessageLinks = []; // Main array for all contacts
var fetchMessages = function(i, cb) {
console.log('Fetching message page #' + (i+1));
$.get(SENT_URL + (i*INCR), function(data){
var $dom = $(data);