- https://www.youtube.com/watch?v=UzyoT4DziQ4 - Virtual Machines, JavaScript, and Assembler
- https://www.youtube.com/watch?v=aHm36-na4-4 - More Instantly Better Vim
- https://www.youtube.com/watch?v=6NHl5Q8zWNY - Kick-Ass Development
- https://www.destroyallsoftware.com/talks/wat - Wat
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/perl | |
# This script finds the number of cycles necessary to get to 1 via the | |
# Collatz conjecture. | |
use strict; | |
use warnings; | |
unless (defined $ARGV[0]) { | |
print("Supply the integer as the first argument."); | |
exit; | |
} |
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
int str_count(char *string, char *delim) { | |
int count = 0; | |
int i; | |
for (i = 0; i < strlen(string); i++) { | |
if (strncmp(&string[i], delim, strlen(string))) { | |
count++; | |
} | |
} | |
return count; |
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
// NOTE: This gist requires https://gist.github.com/boboman13/956405a90345f3ce477c. | |
char **str_split(char *string, char *delim) { | |
uint8_t size = str_count(string, "") + 1, i; | |
char** split = malloc(size * sizeof(char*) ); | |
for (i = 0; i < size; i++) { | |
if (i == 0) | |
split[i] = strtok(string, delim); | |
else | |
split[i] = strtok(NULL, delim); |
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
# Select, insert, update, delete | |
SELECT * FROM `my_table` WHERE `my_field` = 'my_value'; | |
INSERT INTO `my_table` (my_field, another_field) VALUES ('myFieldValue', 'AnotherFieldValue'); | |
UPDATE `my_table` SET `my_field` = 'aNewValue'; | |
DELETE FROM `my_table` WHERE `my_field` = 'a_special_value'; | |
# Get the schema of sorts for a table |
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 <stdio.h> | |
#import <pthread.h> | |
void *threadFunction(void *arg) { | |
// To be executed when called... | |
} | |
int main(void) { | |
pthread_t *thread; |
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/bash | |
BRANCH=master | |
FORMAT=tar.gz | |
EXPORT_LOCATION=/tmp/backup.tar.gz | |
git archive $BRANCH -o $EXPORT_LOCATION --format $FORMAT |
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/bash | |
# Credits to http://askubuntu.com/a/343567 | |
sudo apt-get install python-software-properties -y | |
sudo add-apt-repository ppa:ondrej/php5 -y | |
sudo apt-get update -y | |
sudo apt-get install php5 -y | |
echo "" |
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
/* From https://github.com/brendanashworth/wookie | |
* src/util.h | |
* licensed under MIT license | |
*/ | |
/** | |
* A debug macro that prints out file, line number, then message. | |
* @param msg The debug message to print. | |
*/ | |
#define DEBUG(msg) printf("[DEBUG] %s:%d; %s\n", __FILE__, __LINE__, msg) |
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
var util = require('util'); | |
var events = require('events'); | |
// Create the object constructor | |
function Cat(name) { | |
this.name = name; | |
} | |
// Inherit the EventEmitter | |
util.inherits(Cat, events.EventEmitter); |
OlderNewer