This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: pull requests | |
import "@johnlindquist/kit"; | |
const ghToken = await env('GH_TOKEN', 'Add your Github Personal Access Token'); | |
const repo = 'johnlindquist/kit'; | |
const [owner, name] = repo.split('/', 2); | |
const query = ` | |
query pullRequests($owner: String!, $name: String!) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type NotGoodbye<T> = T extends "goodbye" ? never : T; | |
type Salutation = "hello" | "goodbye"; | |
type AllPossibleWords = string | |
type AllPossibleWordsWithoutGoodbye = NotGoodbye<AllPossibleWords> | |
function neverSayBye(salutation: NotGoodbye<Salutation>, greetee: string) { | |
console.log(`${salutation} ${greetee}`) | |
} | |
neverSayBye('goodbye', 'David'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
typedef struct Node { | |
int data; | |
struct Node *next; | |
struct Node *prev; | |
} Node; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn make-param-str [param-map] | |
(join "&" (map (fn [[key val]] (format "%s=%s" (name key) val)) param-map))) | |
;TODO still needs URL encoding -- format wont work in clojurescript |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Get all methods/properties of some object | |
(goog.object/getKeys some-object) | |
;Getting undefined errors? Use undefined? to probe | |
(undefined? load-namespace) | |
(undefined? str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean isFoo() { | |
int status = this.getStatus(); | |
return (status != STATUS_BAR && | |
status != STATUS_BAZ); | |
} | |
vs. | |
boolean isFoo() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [Created by task 2.0.0 6/5/2012 10:23:30] | |
# Taskwarrior program configuration file. | |
# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-faq', | |
# 'man task-tutorial', 'man task-color', 'man task-sync' or 'man taskrc' | |
# Here is an example of entries that use the default, override and blank values | |
# variable=foo -- By specifying a value, this overrides the default | |
# variable= -- By specifying no value, this means no default | |
# #variable=foo -- By commenting out the line, or deleting it, this uses the default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
source $VIMRUNTIME/vimrc_example.vim | |
source $VIMRUNTIME/mswin.vim | |
"behave mswin | |
if has('gui_running') | |
set guioptions-=T " no toolbar | |
colorscheme obsidian2 | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loglevel = 3; | |
function debug(message, level) { | |
level = level || 1; | |
if ( console ) { | |
if ( level >= loglevel ) { | |
console.log(message); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def tumblr-url "http://pipes.yahoo.com/pipes/pipe.run?_id=4ddef10340ec6ec0374cbd0f73bce819&_render=json") | |
(defn display-count [json-obj] | |
(let [data (js->clj json-obj :keywordize-keys true) | |
post-count (:count data)] | |
(js/alert (str "Number of posts: " post-count)))) | |
(defn display-items [json-obj] | |
(let [data (js->clj json-obj :keywordize-keys true) | |
items (:items (:value data)) |
NewerOlder