Skip to content

Instantly share code, notes, and snippets.

View w3cj's full-sized avatar
🌱

CJ w3cj

🌱
View GitHub Profile
//Single Line
var message = 'Jean shorts 8-bit marfa synth austin, ethical sustainable actually bespoke mumblecore. Slow-carb fixie lo-fi celiac. Master cleanse lumbersexual pickled, shabby chic farm-to-table poutine wolf single-origin coffee chartreuse humblebrag four loko art party fanny pack knausgaard stumptown. Semiotics tumblr viral plaid, crucifix narwhal ugh chicharrones hoodie. Whatever green juice XOXO celiac sartorial, pinterest truffaut cronut crucifix pabst seitan aesthetic lo-fi direct trade. Waistcoat messenger bag cold-pressed lomo marfa, squid humblebrag lumbersexual blue bottle fixie portland typewriter street art. Selvage iPhone salvia ethical.';
//Multi line concat
var message = 'Jean shorts 8-bit marfa synth austin, ethical sustainable actually bespoke mumblecore.'
+ 'Slow-carb fixie lo-fi celiac. Master cleanse lumbersexual pickled, shabby chic farm-to-table poutine'
+' wolf single-origin coffee chartreuse humblebrag four loko art party fanny pack knausgaard stumptown. '
+'Semiotics tum
// https://github.com/jublonet/codebird-js
var cb = new Codebird;
// Obtain a bearer token here: https://github.com/jublonet/codebird-js#application-only-auth
cb.setBearerToken("your bearer token here");
// If you comment out this line, it will use the default proxy created by the codebird author https://api.jublo.net/codebird/
cb.setProxy('https://codebird-proxy.herokuapp.com/');
//https://github.com/jublonet/codebird-js#requests-with-app-only-auth
//https://github.com/jublonet/codebird-js#mapping-api-methods-to-codebird-function-calls
var booksAPI = 'https://www.googleapis.com/books/v1/volumes?q=';
var search = 'Hitchikers Guide To the Galaxy';
$.getJSON(booksAPI + search, function(data) {
console.log(data)
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style media="screen">
.main {
display: none;
}
function searchNetflix(search, page) {
var deferred = $.Deferred();
search = search ? search : '';
page = page ? page : 1;
var yql_url = 'https://query.yahooapis.com/v1/public/yql';
var url = ['http://instantwatcher.com/search?sort=available_from+desc&view=synopsis&infinite=on&average_rating=&year=&runtime=&content_type%5B%5D=1&language_audio=&layout=none&page=', page, '&q=', search.split(' ').join('+') ].join('');
console.log(url);
var query = ['SELECT * FROM html WHERE url="', url, '" and xpath="//div[@class=', "'", 'iw-title list-title box-synopsis-mode', "'", ']"'].join('');
console.log(query);
@w3cj
w3cj / vim.md
Last active December 12, 2020 10:43

Everything you really need to know about vim:

i - insert mode

esc - leave insert mode

: - enter command

q! - quit and ignore changes

macOS Keyboard Shortcuts You Should Know

These keyboard shortcuts will work in most, if not all text editing places in macOS. (Form input, text editors, web browsers etc.) These keyboard shortcuts will also work on Windows (replace CMD with CTRL).

Jump Over Words

ALT + Left/Right

Go to end of line

Challenge 1: Count It

count the letters in a string.

Input

A string - like "Hello World"

Output

Letters and how often they show up. - d:1 e:1 h:1 l:3 o:2 r:1 w:1

Special