This file contains 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
"use strict"; | |
const google = require('googleapis'); | |
const key = require('./credentials.json'); | |
const viewId = 'YOUR_VIEW_ID'; | |
function getUsers(key, viewId) { | |
// https://github.com/google/google-api-nodejs-client#using-jwt-service-tokens | |
const jwtClient = new google.auth.JWT( |
This file contains 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> | |
main(void) { | |
\\ enter alternate screen mode | |
printf("\033[?1049h"); | |
\\ move the cursor to the upper left corner | |
printf("\033[H"); | |
printf("Hello, World"); | |
This file contains 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
diff --git a/demos/basics.scm b/demos/basics.scm | |
index 65280b6..a9b16f9 100644 | |
--- a/demos/basics.scm | |
+++ b/demos/basics.scm | |
@@ -150,20 +150,31 @@ | |
(define smiley1 (make-obj (make-smile-surf (make-random-color)) 300 300)) | |
(define smiley2 (make-obj (make-smile-surf (make-random-color)) 500 300)) | |
- | |
+(define renderer (sdl2:create-renderer! window -1 (list 'accelerated))) |
This file contains 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 rows(puzzle): | |
return [puzzle[9 * i:9 * i + 9] for i in range(9)] | |
def columns(puzzle): | |
return [puzzle[i::9] for i in range(9)] | |
def boxes(puzzle): | |
return [puzzle[i:i + 3] + |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
#!/bin/sh - | |
sleep_blocker=$(pmset -g | grep -m1 "sleep prevented by" | sed -E 's/.+sleep prevented by (.+)\)$/\1/') | |
if [ ! -z "$sleep_blocker" ]; then | |
osascript -e "display notification \"$sleep_blocker\" with title \"Sleep prevention warning\" subtitle \"The following processes are preventing sleep:\"" | |
fi |
This file contains 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
#!/usr/bin/env bash | |
config_file="${config_file:-$HOME/vpn.conf}" | |
if [ ! -f $config_file ]; then | |
echo "could not find config file at $config_file" | |
exit 1 | |
fi | |
username=$(grep -m1 username <$config_file | awk -F\= '{print $2}') | |
if [ -z "$username" ]; then |
This file contains 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
import random | |
import itertools | |
def E(x, y): | |
return (x - y) ** 2 | |
def forward_pass(w, x): | |
x[2] = w[0] * x[0] + w[2] * x[1] |
This file contains 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
sudo cat /var/log/secure | grep invalid | awk '{ print $9 }' | sort | uniq -c | sort -bnr | less |