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
const {TouchBar} = require("electron").remote; | |
const {TouchBarButton} = TouchBar; | |
let thinkingButton = new TouchBarButton({ | |
label: "🤔", | |
backgroundColor: "#7851A9", | |
click: () => { | |
let chatbox = document.getElementsByTagName("textarea")[0]; | |
chatbox.value += " :thinking:"; |
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
const text = "Congratulations! You won the Unreplied giveaway! Here's your promo code: PROMO. Thanks for participating! Make sure you tell all of your Mac friends about it too, they might like it as well!" | |
const codes = fs.readFileSync("promo_codes.txt", "utf8").split("\n"); // A text file with a promo code on each line | |
function generateLine(user) { | |
let encodedText = encodeURIComponent(text).replace(/'/g, "%27").replace("PROMO", codes.pop()); | |
let link = `https://twitter.com/messages/compose?recipient_id=${user.id}&text=${encodedText}`; | |
return `${user.name} (@${user.screen_name}) - ${link}`; | |
} |
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
// https://stackoverflow.com/a/11935263 - Thanks Tim! | |
function getRandomSubarray(arr, size) { | |
var shuffled = arr.slice(0), i = arr.length, temp, index; | |
while (i--) { | |
index = Math.floor((i + 1) * Math.random()); | |
temp = shuffled[index]; | |
shuffled[index] = shuffled[i]; | |
shuffled[i] = temp; | |
} | |
return shuffled.slice(0, size); |
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
const fs = require("fs"); | |
const maybeEligible = JSON.parse(fs.readFileSync('maybe-eligible.json', 'utf8')); | |
const eligible = maybeEligible.filter((entry) => "followed_by" in entry.connections); |
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
const fs = require("fs"); | |
const retweets = JSON.parse(fs.readFileSync('retweets.json', 'utf8')); | |
console.log(retweets.map((retweet) => retweet.user.id).join(",")); |
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
doctype html | |
html | |
head | |
meta(charset='utf-8') | |
meta(name='viewport', content='width=device-width, initial-scale=1') | |
meta(http-equiv='Content-Type', content='text/html; charset=UTF-8') | |
meta(http-equiv='X-UA-Compatible', content='IE=edge') | |
title DNA | |
link(href='http://bootswatch.com/sandstone/bootstrap.min.css', rel='stylesheet') | |
link(rel='icon', type='image/ico', href='http://www.deplex.net/favicon.ico', sizes='32x32') |
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
// Last modified Jan 22, 2014 | |
#include <stdlib.h> | |
@interface AVSystemController : NSObject | |
+ (id)sharedAVSystemController; | |
- (BOOL)setActiveCategoryVolumeTo:(float)arg1; | |
- (BOOL)getActiveCategoryVolume:(float*)arg1 andName:(id*)arg2; | |
@end |
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
//******************************************************************** | |
// Student.java | |
// | |
// Represents a college student. | |
//******************************************************************** | |
import java.util.ArrayList; | |
public class Student { | |
private String firstName, lastName; |
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
<?php | |
class Vehicle { | |
public $name = "Unnamed"; | |
public $doors = 4; | |
public $gates = 1; | |
public $mpg = 25; | |
public $odometer = 0; | |
public $speed = 0; |